Comment by 🦀 jeang3nie

=> Re: "Converting Unix timestamp to date/time" | In: s/programming

Crap, don't get me started on daylight savings time.

=> 🦀 jeang3nie

2023-09-11 · 1 year ago

1 Later Comment

=> 🚀 stack [OP] · 2023-09-11 at 17:05:

I am passing the buck to the user, of course. A variable will keep the timezone adjustment offset, and whoever cares about this will set it to the right amount.

At this point, it is very likely that I will be the only user anyway.

X

Original Post

=> 🌒 s/programming

Converting Unix timestamp to date/time — Without any outside libraries. All we have is a Unix timestamp, seconds since Jan. 1, 1970. I'm looking for a minimalistic solution for my tiny nForth, but really curious if anyone has tricks up their sleeve for this kind of a task. I'm willing to ignore leap seconds for now. So far I got the time part: add timezone in seconds, divide by 86400 to get days, and use the remainder for time in seconds. The rest is trivial, dividing by 60 for minutes and 60...

=> 💬 stack · 10 comments · 1 like · 2023-09-10 · 1 year ago

Proxy Information
Original URL
gemini://bbs.geminispace.org/u/jeang3nie/5213
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
33.588657 milliseconds
Gemini-to-HTML Time
0.602488 milliseconds

This content has been proxied by September (3851b).