how can i convert the system time to format as follows
YYYYMMDDhh:mm:ss-zz:zz
If its eastern the format is 2015091015:10:15-04:00.
Tried to use the following from another question
var timestamp = context.getVariable("system.timestamp"); var mydate = new Date(timestamp); var formatted_date = mydate.toString('yyyyMMddhh:mm:ss');
But it keeps on printing in the following format
formatted_date ThuMay28201500:19:10 GMT-0000(UTC)
Solved! Go to Solution.
I don think toString() supports arguments, I have used http://momentjs.com/ in the past, you can include them in your JS policy for date manipulation and formatting