determining the beginning of a day with timezones AND daylight saving
<p>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 </p>

<pre><code>UserTimeZone = -5.00;
</code></pre>

<p>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.</p>

<p>This is what I'm doing:</p>

<pre><code>DateTime StartDate =  DateTime.Now.ToUniversalTime();

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

DateTime EndDate = StartDate.AddHours(24);
</code></pre>

<p>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.</p>

<p>What are some of your suggestions? Thanks.</p>
