Closed scrudden closed 9 years ago
You are correct. Glad you found it. gpsTime should be in msec yet vehicle.getTimestamp() returns time in seconds.
By the way, I prefer using Time.MS_PER_SEC or Time.SEC_IN_MSECS instead of 1000 because it makes it more clear why doing the conversion.
Let me know if you will create a pull request or if I should make the change myself.
I'd suggest using Java TimeUnit. IMHO, it makes it very clear what conversion is happening and is native Java. For usage examples see: http://www.javaworld.com/article/2074114/core-java/the-highly-useful-java-timeunit-enum.html On Aug 18, 2015 9:09 PM, "skibu" notifications@github.com wrote:
You are correct. Glad you found it. gpsTime should be in msec yet vehicle.getTimestamp() returns time in seconds.
By the way, I prefer using Time.MS_PER_SEC or Time.SEC_IN_MSECS instead of 1000 because it makes it more clear why doing the conversion.
Let me know if you will create a pull request or if I should make the change myself.
— Reply to this email directly or view it on GitHub https://github.com/Transitime/core/issues/12#issuecomment-132408117.
Sean, thanks for the tip on TimeUnit. I've been using constants for so long I didn't realize TimeUnit was a viable alternative.
Closed due to pull request #16.
The GTFS-rt spec states the time stamps for vehicle positions are to be in seconds from epoch not milliseconds.
I expect this should be