+ Start a Discussion
eric_deveric_dev 

UTC Date format in SOQL query - where statement

Hi, i'm developing integration project between salesforce and internal application (c# framework 2.0)

 

i should get Account records that LastModifiedDate greater then last suscesfull run.

SOQL requres date in GMT format.

 

How can i convert 14/06/2009 16:41:38 datetime to 2009-06-14T03:05:41.000Z format

 

 

Thank you

Best Answer chosen by Admin (Salesforce Developers) 
werewolfwerewolf

Use the DateTime.ToString function, like:

 

string dateTime = dt.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'sszzzzz");

All Answers

werewolfwerewolf

Use the DateTime.ToString function, like:

 

string dateTime = dt.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'sszzzzz");

This was selected as the best answer
eric_deveric_dev
Thank you !