noon/midnight....am or pm

  • Thread starter Thread starter Keith G Hicks
  • Start date Start date
K

Keith G Hicks

See: http://physics.nist.gov/News/Releases/questions.html

This has bothered me for some time now because logically 12AM and 12PM could
mean the same thing and either one could be considered midnight or noon as
pointed out in the above webpage. You can find other similar references on
line corroborating this. So now in MS's finite wisdom, how does VBA treat
12AM and 12PM? Which is noon and which is midnight?

Keith
 
Keith said:
See: http://physics.nist.gov/News/Releases/questions.html

This has bothered me for some time now because logically 12AM and 12PM could
mean the same thing and either one could be considered midnight or noon as
pointed out in the above webpage. You can find other similar references on
line corroborating this. So now in MS's finite wisdom, how does VBA treat
12AM and 12PM? Which is noon and which is midnight?


Try this experiment in the immediate window

?Format(#00:00#, "h:nn AMPM")
?Format(#12:00#, "h:nn AMPM")

Note that the hours in a time value range from 0 to 23
starting at midnight.
 
See: http://physics.nist.gov/News/Releases/questions.html

This has bothered me for some time now because logically 12AM and 12PM could
mean the same thing and either one could be considered midnight or noon as
pointed out in the above webpage. You can find other similar references on
line corroborating this. So now in MS's finite wisdom, how does VBA treat
12AM and 12PM? Which is noon and which is midnight?

Keith

Same way as the general standard:

?format(cdate(39202.0),"mm/dd/yyyy hh:nn AM/PM")
04/30/2007 12:00 AM
?format(cdate(39202.5),"mm/dd/yyyy hh:nn AM/PM")
04/30/2007 12:00 PM

AM is "ante meridian" - before midday; noon IS midday, not before midday.
Well... it's not "post meridian" either of course... <g>

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top