DEV Community

Cover image for When you DIY a Time Zone library

When you DIY a Time Zone library

James Turner on April 03, 2019

Cover image by Jon Tyson on Unsplash You are an experienced developer who works on a Calendar application, allowing users to add events to their c...
Collapse
 
ameliagapin profile image
Amelia Gapin

My first project at my first programming job was working on a calendar application. The company's main product, though, was time & attendance and payroll. So it was all dealing with times and timezones. We even had to be able to handle a worker starting in one timezone, crossing a DST change, and then ending in a different timezone.

Time is hard.

Collapse
 
tomasforsman profile image
Tomas Forsman

'You being the experienced developer you know there has to be a list of time zones by country, all you need is that and calculate the difference between the timezones.'

Made me laugh so hard!

'At least your project wasn't needing to calculate the seconds between two points in time, dependent on time zone...'

Got this assignment by a sadistic teacher in the late 90s. Had a lot of fun failing that one and learned to appreciate a good library.

Collapse
 
turnerj profile image
James Turner

Things like time zones and internationalization are funny beasts - they seem simple in one way but explode with complexity if you delve in remotely deep.

Got this assignment by a sadistic teacher in the late 90s. Had a lot of fun failing that one and learned to appreciate a good library.

That would be one hell of an assignment!

Collapse
 
tomasforsman profile image
Tomas Forsman • Edited

And, as you said, add history to the mix and you got a recipe for man made psychosis.

Collapse
 
ahansondev profile image
Alex Hanson

The thing that kills me is when someone provisions a server for my use and it's in my current timezone as opposed to GMT. Then things are all sorts of wacky when looking at logs and processing events 😰

Collapse
 
borgerstoon profile image
Toon Borgers

Obligatory link: youtu.be/-5wpm-gesOY

Collapse
 
turnerj profile image
James Turner

Yep, that video is great and was my inspiration for my post. I link to it at the end of my article. 🙂

Collapse
 
borgerstoon profile image
Toon Borgers

Ah yes, I didn't see that one. Nice post anyways!!