How would you know what I always think or don't think, Cor!
And for your information I don't live in Australia!
If you had 'read it well' you will have noticed that DateString returns
'forever' a string in the MM-dd-yyyy format and not the MM dd yyyy format.
We programmers ALL know that differences in date formats are capable of
causing havoc within software. Thos who don't need to consider another
career. It is not rocket science to use the multitude of date formatting
techniques that will always deal with a date in the 'culture' of the user,
however, time and time again we see software that has 'hard-coded' date
formatting and I consider that to be nothing more than incompentence.
However, for software that will never be used outside a single 'shop' (as in
the application that Bruce has written) it is not unreasonable to settle
upon a single format. The same applies to software that will never be used
outside a single country where everyone uses the same format. Sometimes
people get to carried away in making an application usable by everyone in
the world when the only people who will ever use it are the ones who work 3
offices down the corridor.
I don't know about the Netherlands, but here in New Zealand we are taught in
primary school about the date format that we use in this country and about
the different date formats that are used in various other countries. We also
don't make judgements about whether a country is right or wrong to use the
format that they do and we don't go about telling them that they should use
the ISO format. To do so would be pure arrogance.
For your information, and if you bothered to do some basic research, you
would find that those countries of the world that come under the influence
of the USA, tend to use the the same date format that the USA does, e.g.,
USA, Puerto Rico, The Marianas, American Samoa, various parts of Micronesia
and various parts of the Carribean. Those countries of the world that come
under the influence of the UK or were part of what was called the British
Empire, thend to use the same date format as the UK does, e.g., New Zealand,
Australia, Canada, South Africa, most Pacific Island Nations and a number of
Carribean Island nations. It is really nothing more than accidents of
history.
Here in New Zealand, when speaking, we say 'the 1st of January', 'the 6th of
February', 'the 5th of November', 'the 11th of September', etc, which
correlates to our date format of dd/MM/yyyy. Also, on formal legal documents
you would see the date written as the phrase 'Dated this twenty-ninth day of
February'.
In the USA, when speaking, they say 'January the 1st 2005', 'May the 25th
2006', 'November the 10th 2007', 'September the 11th', etc, which correlates
to their date format of MM/dd/yyyy.
If a certain event had occurred in New Zealand instead of the USA, it would
be known as '11/9' rather than '9/11'.
I have often wondered why the USA uses the format they do (not that I loose
any sleep over it). I conjecture that it was probabaly to do with the
throwing away of various thing British as a result of 1776 and all that.
Cor Ligthert said:
Bruce,
If I have read it well, than DateString returns forever a MM dd yy format.
That format is only used in the USA and some Coca Cola cultures, (Think
about Japan when they are not using their own figurs but not on China).
You would believe that Canada had the same as the USA, but they have it
like England and I thought a more sophisticated way (not like France)..
You can see that it is confusing as Stephany shows. See always thinks that
more people know about those very different culture differences when
writing date and time. (it is not only the date it is as well with times),
in my idea are it only a few.
Somebody wrote ones in this newsgroup. I live in Australia, we will never
use American software because it gives always troubles with dates
(Australia has the same time standards as the USA). I assume that he
meant with we his company, before I get some responses from Stephany.
(I gave the full string, like Stephany I did not know how many times a day
you would write a log file, beside that is the ISO way better when you do
a Dir in your log directory).
Cor
Bruce W. Darby said:
I did not knew this function. Not so strange:. if I understand it well,
than it is outside the USA completely useless.
I didn't see any warnings that it would not be useful outside the United
States. Perhaps it's a method that is much the same as the 'Shortdate'
method SpamCatcher mentioned.
In my idea is this construction beneath the nicest for your purpose
Dim mylogfiledate As String = Now.ToString("yyyyMMddhhmmss")
I hope this helps,
Thanks for the formatting string above, Cor. If you didn't want the
hours, minutes, seconds, I take it that you just don't include them in
the formatting string? I'll keep it in mind, but what I was actually
doing is concatenating the date into the file path, as in...
Dim strFullFilename As String = strPathName & "\" & DateString &
[filename.ext]
DateString returns a string formatted as 12-25-2006, which worked
perfectly for what I needed.
When I attempted to use another Date format, the slashes in the date were
interpreted as directory seperators and it created a directory structure
where12 was its own directory with a subdirectory of 25, etc.
I'm learning... thanks for your input!