Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

This is one this I'm thankful for in the .Net framework. Give it any datetime in UTC, then give it a time zone and it spits out a local time. There is zero work to do.


While I admit that using a framework instead of your own solution is a good solution, please note that that's not "zero work", it just passes the buck to the client. The framework's knowledge of the timezones still has to be kept up to date. For example, Israel used to have ad-hoc DST times changing each year and "...the unpredictability of IDT in Israel became frustrating enough that Microsoft Windows stopped trying to track changes and just made Israeli time be Greenwich Mean Time plus two hours (GMT+2) (and disabled the daylight saving option). This has led to various ad hoc solutions to the problem in Windows systems and other Microsoft software (e.g. Outlook calendar entries are often off by an hour when shared, due to the lack of IDT support)." [1]

[1]http://en.wikipedia.org/wiki/Israel_Summer_Time


This isn't limited to .Net - any modern standard library offers this feature.


You realize that the tzdb files this functionality depends on has several updates each year that are probably never being installed on 90% of computers?


Yes, of course.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: