@@ -77,6 +77,7 @@ var DailyRotateFile = module.exports = function (options) {
77
77
this . eol = options . eol || os . EOL ;
78
78
this . maxRetries = options . maxRetries || 2 ;
79
79
this . prepend = options . prepend || false ;
80
+ this . localTime = options . localTime || false ;
80
81
81
82
if ( this . json ) {
82
83
this . stringify = options . stringify ;
@@ -122,13 +123,21 @@ var DailyRotateFile = module.exports = function (options) {
122
123
} . bind ( this ) ( ) ;
123
124
124
125
var now = new Date ( ) ;
125
- this . _year = now . getUTCFullYear ( ) ;
126
- this . _month = now . getUTCMonth ( ) ;
127
- this . _date = now . getUTCDate ( ) ;
128
- this . _hour = now . getUTCHours ( ) ;
129
- this . _minute = now . getUTCMinutes ( ) ;
130
- this . _weekday = weekday [ now . getUTCDay ( ) ] ;
131
-
126
+ if ( this . localTime ) {
127
+ this . _year = now . getFullYear ( ) ;
128
+ this . _month = now . getMonth ( ) ;
129
+ this . _date = now . getDate ( ) ;
130
+ this . _hour = now . getHours ( ) ;
131
+ this . _minute = now . getMinutes ( ) ;
132
+ this . _weekday = weekday [ now . getDay ( ) ] ;
133
+ } else {
134
+ this . _year = now . getUTCFullYear ( ) ;
135
+ this . _month = now . getUTCMonth ( ) ;
136
+ this . _date = now . getUTCDate ( ) ;
137
+ this . _hour = now . getUTCHours ( ) ;
138
+ this . _minute = now . getUTCMinutes ( ) ;
139
+ this . _weekday = weekday [ now . getUTCDay ( ) ] ;
140
+ }
132
141
var token = / d { 1 , 4 } | m { 1 , 4 } | y y (?: y y ) ? | ( [ H h M ] ) \1? / g;
133
142
var pad = function ( val , len ) {
134
143
val = String ( val ) ;
0 commit comments