eskerda / citybikes-api

10 stars 2 forks source link

Wrong timestamps #15

Closed eskerda closed 8 years ago

eskerda commented 8 years ago

https://github.com/eskerda/pybikes/issues/141

tuxayo commented 8 years ago

There's an rstrip of zerores on datetimes on the api, hence any date with 0 on seconds will become nothing: https://github.com/eskerda/citybikes-api/blob/master/api/models.py#L116

In what cases is the rstrip() is necessary?

eskerda commented 8 years ago

Job precision only reached up to three decimals, so the idea was to get rid of redundant zeroes, like:

That introduced this, which is clearly a bug. I would say there are no real cases were rstrip is necessary.

tuxayo commented 8 years ago

Job precision ?

eskerda commented 8 years ago

Fixed.

Job precision ?

Either that or how timestamps are being stored, the last three digits on the seconds are redundant, since precision only reaches up to the third one. Such optimization introduced the bug so, being that the case, it does not really matter much if the zeroes are redundant or not.

tuxayo commented 8 years ago

Fixed.

Now the timestamps look like "2016-05-19T17:56:15.383000Z" so I guess it's also deployed, thanks a lot! :-D