vegeta897/snow-stamp

Return date in ISO 8601 format for ease of entry into databases

Closed this issue · 3 comments

Hello! I use your tool for inserting the join dates and promotion dates of users into a MySQL database. Would it be possible to get the output in YYYY-MM-dd HH:mm:ss format to match ISO 8601?

I'd be happy to add that to the page.

But in the meantime, if you're already working with a database, wouldn't it be easier to do it programmatically? The math to convert a snowflake ID to a UNIX time integer is snowflake / 4194304000 + 1420070400, so with MySQL you can do FROM_UNIXTIME(snowflake / 4194304000 + 1420070400) to get a datetime value.

Thank you so much for this algorithm!!! I still use this tool for users who have left my Discord and I need to substitute their first message for a join date, but this algorithm helps cut down on the time it takes for me to import users into my organization IMMENSELY.

You're welcome! I very much appreciate you letting me know how it worked out for you.