Convert _CreatedAt - Javascript Assistance
Thank you, it worked. I had to also change var goalTimeZone = -7; to var goalTimeZone = -14; to get the Pacific Standard Time (California Time)
Regards, and thank you so much for your help.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Thank you, it worked. I had to also change var goalTimeZone = -7; to var goalTimeZone = -14; to get the Pacific Standard Time (California Time)
Regards, and thank you so much for your help.
Hi,
When it's daylight saving, I have to manually adjust the time in the code by one hour. I'm thinking to apply the following:
Get current month
If month is between 3 and 11 then goal time zone = -14
else - 16
Can you please help me with that? Does that seem like a solution? The problem is that daylight savings change each year...
Hi Mike,
Yes it's possible. But i guess you need to narrow daylight period criteria..
Here is a requested code:
pre
var stringDate = value;
var arrDate = stringDate.split(/[- :]/);
var date = new Date(arrDate[0], arrDate[1]-1, arrDate[2], arrDate[3], arrDate[4]);
//You can change timezone here;
var goalTimeZone = -16;
var month = date.getMonth() + 1;
if(month 3 && month < 11)
goalTimeZone = -14;
date = new Date(date.getTime() + (goalTimeZone * 3600 * 1000));
console.log(date);
return date.toUTCString().replace(/GMT/gi, "");
/pre
Regards.