Skip to content

Tag: timestamp

query mongoDb to substract timestamp

I want a query to subtract day from a Date. I test this: {“lastSeen”: { “$gte”: {“$date”: { $subtract: [ “$date”, 1616000000 ] }}}} But doesn’t work. I have this error on Gamesparks. Error parsing JSON. Please use valid JSON, including double-quotes on obj…

Javascript timestamp number is not unique

I need a unique number to be generated to be used in my code.I use I know the above returns the number of milliseconds. But the values are not unique.For example :1385035174752.This number is generated twice or more than that. My question is Why is it not unique? and how do i get unique number from current da…