Adjust for DST in days since 2000.
This commit is contained in:
parent
2c48a6c8d9
commit
45b86691ed
1 changed files with 4 additions and 4 deletions
|
@ -222,10 +222,10 @@ SensingPrims.prototype.primTimeDate = function(b) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
SensingPrims.prototype.primTimestamp = function() {
|
||||
var now = new Date();
|
||||
return (now.getTime() - 946677600000) / 86400000;
|
||||
// (now - ms since 1/1/2000) / ms in a day
|
||||
SensingPrims.prototype.primTimestamp = function(b) {
|
||||
var now = new Date(), epoch = new Date(2000,0,1), dst = now.getTimezoneOffset() - epoch.getTimezoneOffset(), msSince = now.getTime() - epoch.getTime();
|
||||
msSince += (now.getTimezoneOffset() - dst) * 60000;
|
||||
return msSince / 86400000;
|
||||
}
|
||||
|
||||
// Helpers
|
||||
|
|
Reference in a new issue