Convert to the UTC time to Local Time

Convert to the UTC time to Local Time

Post by SXZhb » Sun, 13 Feb 2005 01:55:02


Hi,
Well, my problem is that I did a page in content 2002 that showing the sites
modified in the 2 days before, but the hour is wrong, because I need a code
that show me how to do it, who can help me, I dont have very experience in
programming, because I need to code.

Best regards
 
 
 

Convert to the UTC time to Local Time

Post by Mei Ying [ » Sun, 13 Feb 2005 03:16:46

Hi

If you are displaying the time, try DateTime.ToLocalTime(). e.g.

Posting p = CmsHttpContext.Current.Posting;
Response.Write("Last Modified Date " +
p.LastModifiedDate.ToLocalTime().ToString("dd MMM yyyy hh:mm tt");

--
regards
Mei Ying
---
Blog: http://www.yqcomputer.com/
Contact: XXXX@XXXXX.COM
Book: http://www.yqcomputer.com/
---