First note that the comments in front of the DateSerial function are wrong. It should read as;
[tt]D = DateSerial(3, 2, 1) 'always Feb [tt]1[/tt], 2003[/tt]
>But it does change its output against local settings.
Of couse the output representation is locale dependent... until you format it using Format function.
I was talking about the input format; how the date is interpreted. Which number is treated as month and which as day. It becomes locale dependent if you assign string dates and locale independent if you use genuine date literals using # symbols.
The date output using Format function is locale independent as you explicitly specify the format yourself using M,D and Y. On the other hand the output of FormatDateTime function is locale dependent as it uses named formats which are based on system settings.
Instead of using string dates, I still recommend you to use date literals, because of the following reasons.
1. "01-04-2004" may be interpreted as April 1 or January 4. However, #4/1/2004# will always be interpreted as April 1.
2. Using actual date variables, you gain the flexibility of manipulating dates as numbers as I described above; which is not possible with strings.
Many thanks agin. Tries another star, but don't think it will give it. Now I get it, and will use date literals as you suggest. Many thanks for all your help. Regards
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.