File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -2905,10 +2905,19 @@ const EasyCoder_Core = {
2905
2905
content : ``
2906
2906
} ;
2907
2907
case `now` :
2908
+ function isDST ( d ) {
2909
+ let jan = new Date ( d . getFullYear ( ) , 0 , 1 ) . getTimezoneOffset ( ) ;
2910
+ let jul = new Date ( d . getFullYear ( ) , 6 , 1 ) . getTimezoneOffset ( ) ;
2911
+ return Math . max ( jan , jul ) !== d . getTimezoneOffset ( ) ;
2912
+ }
2913
+ let now = Math . floor ( Date . now ( ) / 1000 )
2914
+ if ( isDST ( now ) ) {
2915
+ now += 3600
2916
+ }
2908
2917
return {
2909
2918
type : `constant` ,
2910
2919
numeric : true ,
2911
- content : Math . floor ( Date . now ( ) / 1000 )
2920
+ content : now
2912
2921
} ;
2913
2922
case `millisecond` :
2914
2923
return {
Original file line number Diff line number Diff line change @@ -2905,10 +2905,19 @@ const EasyCoder_Core = {
2905
2905
content : ``
2906
2906
} ;
2907
2907
case `now` :
2908
+ function isDST ( d ) {
2909
+ let jan = new Date ( d . getFullYear ( ) , 0 , 1 ) . getTimezoneOffset ( ) ;
2910
+ let jul = new Date ( d . getFullYear ( ) , 6 , 1 ) . getTimezoneOffset ( ) ;
2911
+ return Math . max ( jan , jul ) !== d . getTimezoneOffset ( ) ;
2912
+ }
2913
+ let now = Math . floor ( Date . now ( ) / 1000 )
2914
+ if ( isDST ( now ) ) {
2915
+ now += 3600
2916
+ }
2908
2917
return {
2909
2918
type : `constant` ,
2910
2919
numeric : true ,
2911
- content : Math . floor ( Date . now ( ) / 1000 )
2920
+ content : now
2912
2921
} ;
2913
2922
case `millisecond` :
2914
2923
return {
You can’t perform that action at this time.
0 commit comments