怎么做网站呢,舞钢市城乡建设局网站,近期国内重大新闻,杭州网站公司1、问题
云函数部署后cron-parser解析0点会变成8点
考虑可能是时区的问题
然后看文档发现果然有问题#xff0c;云函数环境是utc0 2、解决
看了半天cron-parser文档发现
Using Date as an input can be problematic specially when using the tz option. The issue bein…1、问题
云函数部署后cron-parser解析0点会变成8点
考虑可能是时区的问题
然后看文档发现果然有问题云函数环境是utc0 2、解决
看了半天cron-parser文档发现
Using Date as an input can be problematic specially when using the tz option. The issue being that, when creating a new Date object without any timezone information, it will be created in the timezone of the system that is running the code. This (most of times) wont be what the user will be expecting. Using one of the supported string formats will solve the issue(see timezone example).
* *iterator* - Return ES6 compatible iterator object * *utc* - Enable UTC * *tz* - Timezone string. It wont be used in case utc is enabled
大概就是tz就是设置时区的方法
然后查找时区字符值
中国, 亚洲: 当前本地时间 日期、时区和时差
parser.parseExpression(task.do_cron,{tz: Asia/Shanghai});
果然可以 问题解决~