-
• #2
Odd - what happens if you do
(new Date()).toString()
-
• #3
Hmm, it's right:
"Fri Jun 9 2017 10:36:48 GMT+0000"
-
• #4
Strange. Maybe it's the way you do
new Date(Date.now())
rather than justnew Date()
- I guess it could also be a bracketing thing.Also, the values returned for
getMonth
/etc start from 0 - not 1. So you'd expect this month - the 6th month - to return 5. The fact the days are wrong is very strange though -
• #5
Good to know re month, thanks.
Ahhhhhhhhhhhh, getDay() is Day of Week!
User error completely :-) Ignore me ;-)
-
• #6
No problem - glad it's sorted ;)
I've having a weird issue on Puck with datetime.
I have "Send time to Espruino" set in the IDE.
If I do new Date(Date.now()).getHours() or new Date(Date.now()).getMinutes(), I get the right thing.
But new Date(Date.now()).getMonth() is returning 5 and new Date(Date.now()).getDay() is also returning 5. (That's for today). Yesterday it was 4 for getDay().
This is on 1v92 using standalone Windows IDE espruino_ide_win64_0v65.9
Any idea where this offset could be coming from?