8000 Merge pull request #152 from Atinux/master · github4f/node-cron@1c6ad5b · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c6ad5b

Browse files
committed
Merge pull request kelektiv#152 from Atinux/master
Fix the timezone issue from 1.0.7
2 parents a6ca5b9 + b8f0423 commit 1c6ad5b

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