You need to sign in to do that
Don't have an account?

How to convert system.now to 2014-12-23T06:00:00.000Z format?
Hi all,
How to convert the system.now() date time format (2014-12-23 13:19:13) to the following format 2014-12-23T06:00:00.000Z ?
Thanks.
How to convert the system.now() date time format (2014-12-23 13:19:13) to the following format 2014-12-23T06:00:00.000Z ?
Thanks.
Try the below Code.
yes this is in String Format.
But using parse method you can not convert to DateTime again.
Datetime d = System.now(); //Returns GMT time, also SF stores all datetime in objects in GMT format only.
String dt = String.valueOf(d.dateGmt())+'T'+String.valueOf(d.timeGmt());