Discussion:
Converting CRMDatetime to Text gives one hour difference
(too old to reply)
Sourab Gupta
2010-03-29 21:57:01 UTC
Permalink
Hi All

I have one custom entity with one CRM Date Time Field that accepts date and
as well as Time.

I use this to convert from date time to string

CRMDateTime dt= new CRMDateTime();
dt=Convert.ToDateTime(new_date.Value).ToLocalTime();

But the problem I am facing is , it gives one hour difference

like if the Date I saved is 3/29/2010 and time is 10:30 AM

when i convert to string i get 3/29/2010 time 9:30 AM.

Please help.
Mercure Integration
2010-03-30 12:48:24 UTC
Permalink
Did you check your local settings on your client (Tools > Options > General
Timezone)? And the Timezone of the user you are using (System, an
Administrator, another user)? The format of the new_date.Value is UTC and
ToLocalTime is using the current user's specific timezone... If I remember
well...
__________________________________
Mercure Integration Support Team
http://www.mercureintegration.com
Hi All
I have one custom entity with one CRM Date Time Field that accepts date and
as well as Time.
I use this to convert from date time to string
CRMDateTime dt= new CRMDateTime();
dt=Convert.ToDateTime(new_date.Value).ToLocalTime();
But the problem I am facing is , it gives one hour difference
like if the Date I saved is 3/29/2010 and time is 10:30 AM
when i convert to string i get 3/29/2010 time 9:30 AM.
Please help.
Loading...