8000 Fix the timezone issue from 1.0.7 · github4f/node-cron@b8f0423 · GitHub
[go: up one dir, main page]

Skip to content

Commit b8f0423

Browse files
committed
Fix the timezone issue from 1.0.7
1 parent a6ca5b9 commit b8f0423

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/cron.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ CronTime.prototype = {
9696
*/
9797
sendAt: function() {
9898
var date = this.realDate ? this.source : moment();
99+
// Set the timezone if given (http://momentjs.com/timezone/docs/#/using-timezones/parsing-in-zone/)
99100
if (this.zone)
100-
date = date.utcOffset(this.zone);
101+
date = date.tz(this.zone);
101102

102103
if (this.realDate)
103104
return date;

0 commit comments

Comments
 (0)
0