Add (days since 2000) block. For some reason it is around 1/100th off for me.
This commit is contained in:
parent
64fb52699c
commit
234e044660
1 changed files with 7 additions and 0 deletions
|
@ -31,6 +31,7 @@ SensingPrims.prototype.addPrimsTo = function(primTable) {
|
|||
primTable['getAttribute:of:'] = this.primGetAttribute;
|
||||
|
||||
primTable['timeAndDate'] = this.primTimeDate;
|
||||
primTable['timestamp'] = this.primTimestamp;
|
||||
}
|
||||
|
||||
SensingPrims.prototype.primTouching = function(b) {
|
||||
|
@ -221,6 +222,12 @@ 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
|
||||
}
|
||||
|
||||
// Helpers
|
||||
SensingPrims.prototype.mouseOrSpritePosition = function(arg) {
|
||||
if (arg == "_mouse_") {
|
||||
|
|
Reference in a new issue