bwentzloff / trading-bot

Code seen in Cryptocurrency Trading YouTube video here: https://youtu.be/fpqzXgZjSqM
400 stars 262 forks source link

How to retrive the timestamp from poloniex ? #35

Open r-neri opened 6 years ago

r-neri commented 6 years ago

anyone knows how to retrieve the timestamp from poloniex of a determined day? these numbers dosent make any sense to me : 14910480000 as startime and 1491091200 as endtime.

I want to retrieve the timestamp for any past day. Any guess? Thank you

Bobpick commented 6 years ago

The large number is the Epoch date: The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). Literally speaking the epoch is Unix time 0 (midnight 1/1/1970), but 'epoch' is often used as a synonym for 'Unix time'. Many Unix systems store epoch dates as a signed 32-bit integer, which might cause problems on January 19, 2038 (known as the Year 2038 problem or Y2038). The converter on this page converts timestamps in seconds, milliseconds and microseconds to readable dates.

To get the date and time of a starttime and endtime, look at this link:
https://www.epochconverter.com/

I hope this helps.

r-neri commented 6 years ago

Thanks Bobpick this helps a lot

donkhu commented 6 years ago

you can convert it with pythons datetime library

donkhu commented 6 years ago

https://docs.python.org/2/library/time.html#module-time