Page 1 of 1

UTC Date to Local Date

Posted: Wed Feb 13, 2013 3:24 am
by kcalexander71
Dates are stored in the database as UTC. How do I render them in the report as Local Date?

Thanks.

Re: UTC Date to Local Date

Posted: Wed Feb 13, 2013 6:22 am
by Alex K.
Hello,

You can use the following code:

Code: Select all

{TimeZoneInfo.ConvertTimeFromUtc(DataSource.ColumnName, TimeZoneInfo.FindSystemTimeZoneById("AUS Eastern Standard Time")).ToLocalTime()}
Please check the following link:
http://stackoverflow.com/questions/2580 ... n-database

Thank you.

Re: UTC Date to Local Date

Posted: Wed Feb 13, 2013 6:10 pm
by kcalexander71
Yes, that works after adding reference to System.Core.Dll to the Report. Thanks for your help.

Re: UTC Date to Local Date

Posted: Thu Feb 14, 2013 7:23 am
by Alex K.
Hello,

We are always glad to help you!

Thank you.