Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

date.toDateString() gives UTC date instead of local

It appears that when I use the date.toDateString() method, I get the UTC date

 

The Date object is what is passed into clock.ontick()

 

This documentation doesn't say whether the clock.ontick() passes local or UTC date:

build slant reference slant device-api slant clock

(I can't believe it won't let me pass a fitbit URL, this ought to be allowed as well)

It'd be good to enhance this doc with that information.

 

How do I get the local date instead of the UTC date from the clock.ontick object?

Best Answer
0 Votes
1 REPLY 1

It looks like if you want the local date, you can't use the toDateString, you have to concatinate the individual values.

getDate() gives local date

getUTCDate() gives UTC date

 

Best Answer
0 Votes