LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How does VBA interpret Dates?

Just to add to Dave's advice, in VBA if you have a date string/text, it will
be interpreted as a US format if possible (mm/dd/yy).

--
Regards,
Tom Ogilvy


"Greg Glynn" wrote:

Living and working in Australia, our conventional way to represent
dates is dd/mm/yy. I think our American cousins us mm/dd/yy as their
default.

Is VBA, I get this:

MyDate = #13/12/2007#
? Month(mydate)
12
In this instance, VBA interprets the 2nd qualifier as the month (12),
possibly because 13 cannot be a month.


MyDate = #11/12/2007#
? Month(mydate)
11
In this instance, VBA interprets the 1st qualifier as the month.

This is causing me grief because I have an application that reads text
files and tries to interpret US style dates. Can anyone give me
guidance on the best way to interpret dates?

Thanks in advance.


Greg


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determine and interpret the P-Value roystonteo via OfficeKB.com Excel Discussion (Misc queries) 2 February 6th 09 05:34 AM
How do I interpret the result of a chitest? Anne Excel Discussion (Misc queries) 1 May 22nd 08 04:44 PM
Interpret code FIRSTROUNDKO via OfficeKB.com Excel Programming 4 March 22nd 06 06:21 PM
Why does Excel interpret 2/29 as Feb 1st? Jo Excel Discussion (Misc queries) 6 February 26th 05 06:06 PM
Could some one please help me to interpret the following syntax Augustus Excel Programming 5 March 3rd 04 09:55 AM


All times are GMT +1. The time now is 11:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"