Date.now().getTime() - milliseconds on all platforms?

56 visualizações
Pular para a primeira mensagem não lida

der Raab

não lida,
19 de out. de 2016, 05:55:2319/10/2016
para Haxe
Hi again. I'd like to have some clarification regarding the Date objects getTime() method please. :)

http://api.haxe.org/Date.html says that getTime()
Returns the timestamp of the date. It might only have a per-second precision depending on the platforms.

I misinterpreted that and thought it will return the timestamp in seconds with possible three fractional digits (because it's a float)  - but at least in JavaScript it returns milliseconds. So my question is:

Am I right when I expect it to return always milliseconds on all platforms - with three zeros at the end if the platform has only second precision?

Alexander Kuzmenko

não lida,
19 de out. de 2016, 06:00:0619/10/2016
para Haxe
it's alwais milliseconds amount without fractional part.

среда, 19 октября 2016 г., 12:55:23 UTC+3 пользователь der Raab написал:

Ashiq A.

não lida,
19 de out. de 2016, 07:49:2519/10/2016
para haxe...@googlegroups.com
Hi,

Yes, it returns an integer with three zeros at the end if it only has per-second precision. 

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

der Raab

não lida,
19 de out. de 2016, 07:57:4219/10/2016
para Haxe
Cool - already updated on github! Thanks
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem