I’m currently working on a web service using .NET that returns information about the users in a system. This web service has to be general enough to be used by other systems written in Java, PHP etc. My problem is that it has to return the default time zone and I’m not sure about what format I should use to return the time zone, so that it can be easily used by other systems.
What do you recommend?
The most adopted way of describing time zones is the “Olson” zone info database: http://www.iana.org/time-zones.
Most programming languages and frameworks have libraries to do datetime calculations based on that zoneinfo database. In some cases it is even built in (PHP that I know of), in Python the default implementaion is called pytz. If your are looking for JavaScript implementations there is a time zone detection script here and a datetime calculation script here.
Only if you are working with very obscure frameworks/languages will you need to implement datetime logic around the zoneinfo database yourself.
Since you are working with .NET you may find this question helpful: .NET TimeZoneInfo from Olson time zone. Consider using a library like noda-time which foregoes .NET’s TimeZoneInfo in favour of Olson timezones.
More .NET info her: TimeZoneInfo vs. Olson database