RE: Date and Time questions

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Adrian Mascarenhas (adrianma_at_online.microsoft.com)
Date: 08/11/04


Date: Wed, 11 Aug 2004 21:03:19 GMT


>
>1. How do I display median (AM, PM)
>I use code like:
>ToString("MMMM, dd yyyy hh:mm") to format DateTime
>

See DateTimeFormatInfo class. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemGlobalizationDateTimeFormatInfoClassTopic.asp
it has a format pattern of "t" or "tt" for specifying AM/PM.

eg. ToString ("h:mm tt") will give you "9:30 AM".

>2. I get UTC time. I know time zone (i.e. hours offset). How do I display
>time properly taking into account Daylight savings?
>

msdn is really slow right now, sorry i cant get the answer to this question.

--
Adrian Mascarenhas, Developer Division 
This posting is provided "AS IS" with no warranties, and confers no rights.
Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.