LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

 
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
Linking computer dates (time) to spreadsheet dates that have formu bigisle Excel Worksheet Functions 3 January 3rd 10 08:05 PM
Excel not recognizing dates as dates lawson Excel Discussion (Misc queries) 1 June 26th 07 04:39 PM
Calculating number of days between two dates that fall between two other dates [email protected] Excel Discussion (Misc queries) 5 October 26th 05 06:18 PM
How do I get the dates on an excel chart to stay as dates instead. Rani Charts and Charting in Excel 1 September 20th 05 05:56 PM
Charting data against dates where dates are not at fixed intervals PK Charts and Charting in Excel 4 June 16th 05 05:08 AM


All times are GMT +1. The time now is 06:24 AM.

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"