function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
LogmiLogmi 

Time Zone's/Local Time

Hi.  I'm having some trouble understanding GMT UTC and local time.  I am creating a task object with a datetime fields.  Here is the code I'm using.
 

DateTime tempTime;

tempTime = new DateTime();

if (PickupTime.Length > 0)

{

tempTime = DateTime.ParseExact(PickupTime, "yyyy-MM-dd HH:mm:ss", null);

tk[10] = doc.CreateElement("Local_Pickup_Time__c");

tk[10].InnerText = (tempTime.ToUniversalTime()).ToString("s");

}

If I have a value PickupTime = "2008-11-03 19:18:53", which is 2:18pm EST, the value I end up with in my Local_Pickup_Time_cc is 11/3/2008 1:18 PM.  Which is one hour earlier.  Does anyone know why?

Vijay RautVijay Raut
Have you checked Time Zone setting of the User (using which you are performing this operation).

LogmiLogmi

It looks right on the User Detail page.  Is that the only place to set time zone?

Time Zone(GMT-05:00) Eastern Daylight Time (America/New_York)

All the record creating datetimes are correct.