Question: I'm storing the user's timezone as a decimal in the session. For instance, if the user is in the EST timezone, I'd have 

```
UserTimeZone = -5.00;

```

The data in the database is stored in UTC, so I want to calculate the beginning and the end of the day for that user so that when the user wants his data for a specific day, the records are timezone adjusted.

This is what I'm doing:

```
DateTime StartDate =  DateTime.Now.ToUniversalTime();

StartDate = StartDate.AddHours((double)UserTimeZone);
StartDate = StartDate.Date;
StartDate = StartDate.AddHours((double)UserTimeZone);

DateTime EndDate = StartDate.AddHours(24);

```

The problem I'm having is that this doesn't account for daylight saving time so even thought EST time is 5 hours behind UTC, for the moment it's actually 4 hours behind UTC because of the daylight saving shift.

What are some of your suggestions? Thanks.

Answer: 
You will need to use JavaScript to gather the necessary information from the user's browser - for this part see <http://www.onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/>

When you have this information you can setup `UserTimeZone` (btw this should NOT be an `int` as there are timezones with fractions of hours!) to accomodate the current timezone including DST...
You need time-zone file <http://www.twinsun.com/tz/tz-link.htm>  

`Record all you time in UTC/GMT.`

Day Light saving is not consistent, countries change their DLS rule.  

Hence your application will need up-to-date Tz file at all the time.

Your user should choose `Time-Zone name` when signing up and not time-offset. Because two regions can have same time offset (sometimes with DLS).

With `Tz Name` you can know  

- what **country/region** user belongs to;  

- what is `his time offset`;  

- and what is `his DLS offset`,  

`add these both` to get users current time.

Known Issue: Time in history cannot be converted to actual time if you don't have historic DLS details, as these may not be valid at that historic time.