I am trying to googling for passing in acceptable parameters for setting up cronJobs based on a users timeZone. Im using a cronJob module which can be found here.
https://github.com/ncb000gt/node-cron
The problem is I need to pass different timeZones but I can't seem to find the acceptable parameters and format for the different timezones. Can anyone point me in the right direction?
Try converting the time to a common timezone before registering it with node-cron.
Here's a conversion example from another question.
From How to use timezone offset in Nodejs? :
var time = require('time');
var a = new time.Date(1337324400000);
a.setTimezone('Europe/Amsterdam');
console.log(a.toString()); // Fri May 18 2012 09:00:00 GMT+0200 (CEST)
a.setTimezone('Europe/Kiev');
console.log(a.toString()); // Fri May 18 2012 10:00:00 GMT+0300 (EEST)
I found it. For anyone encountering a similar problem here is a reference list by time zone acceptable for node.js. I believe its standard OS time zone stuff.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.