View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ExcelMonkey[_85_] ExcelMonkey[_85_] is offline
external usenet poster
 
Posts: 1
Default Excel vs VBA Dates

In excel I can create hourly dates over a 24 hour period that rang
from:

1/1/2002 0:00

to

1/1/2002 23:00

Thus it uses military time. By using the format m/d/yyyy h:mm an
adding 1/24 each hour.

But when I try this in VBA I get:

1/1/2004 0:00
1/1/2004 1:00:00 AM
1/1/2004 2:00:00 AM
1/1/2004 3:00:00 AM
1/1/2004 4:00:00 AM
1/1/2004 5:00:00 AM
1/1/2004 6:00:00 AM
1/1/2004 7:00:00 AM
1/1/2004 8:00:00 AM
1/1/2004 9:00:00 AM
1/1/2004 10:00:00 AM
1/1/2004 11:00:00 AM
1/1/2004 12:00:00 PM
1/1/2004 1:00:00 PM
1/1/2004 2:00:00 PM
1/1/2004 3:00:00 PM
1/1/2004 4:00:00 PM
1/1/2004 5:00:00 PM
1/1/2004 6:00:00 PM
1/1/2004 7:00:00 PM
1/1/2004 8:00:00 PM
1/1/2004 9:00:00 PM
1/1/2004 10:00:00 PM
1/1/2004 11:00:00 PM

Is there any way in VBA to express m/d/yyyy h:mm in military time?

Thank

--
Message posted from http://www.ExcelForum.com