+ Start a Discussion

Datetime format with GMT

Iam having hard time in creating the date format in Apex code,
Variable to store : Datetime dte
Need to store time in this format :'1999-05-31T13:20:00-05:00' ;

Rajiv Bhatt 16Rajiv Bhatt 16
What have you already tried? Did you use the the DateTime.format() method to format the date that you have? Please give it an attempt and share the code if you still face any issues. Here is a helpful reference https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_datetime.htm#apex_System_Datetime_formatGmt