Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 352333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:43:38+00:00 2026-05-12T11:43:38+00:00

I want to compute the time 4 hours later during the DST transition, either

  • 0

I want to compute the time 4 hours later during the DST transition, either into DST or out of it.

Currently doing this:

DateTime now = DateTime.now();
DateTime later = now.AddHours(4);
System.Console.WriteLine(now + " isDST " + now.IsDaylightSavingTime());
System.Console.WriteLine(later + " isDST " + later.IsDaylightSavingTime());

Provides:

11/1/2009 12:45:54 AM isDST True
11/1/2009 4:45:54 AM isDST False

What I want to see is:

11/1/2009 12:45:54 AM isDST True
11/1/2009 3:45:54 AM isDST False

The “best” way I’ve found to do this is to take a round trip through UTC like this:

DateTime now = DateTime.now();
DateTime later = now.ToUniversalTime().AddHours(4).ToLocalTime;
System.Console.WriteLine(now + " isDST " + now.IsDaylightSavingTime());
System.Console.WriteLine(later + " isDST " + later.IsDaylightSavingTime());

It seems I should be able to specify to AddHours() that the time returned should be elapsed time or display time. What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:43:38+00:00Added an answer on May 12, 2026 at 11:43 am

    I don’t think you’re missing anything. It sounds like DateTime could have a better documented or richer interface, but MSDN recommends using UTC exactly like you are.

    There’s a cute time difference between .NET and win32 in displaying times from a different daylight savings’ rule than the present. .NET will display the time as it would have been displayed at that time, while win32 will always give it in terms of the current daylight savings flag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've received a new computer from my employer. This time I don't want to
This is something that has frustrated me for a long time (dozens of hours)
I'm new to Python, and confused by the date/time documentation. I want to compute
I want to compute the delta of time, a subtraction, between two XmlGregorianCalendar objects,
I want to program my computer to start automatically at several time intervals. From
For use in a rigid body simulation, I want to compute the mass and
I want to ask how to add a computed column in BIRT that compute
I want to search the computer from this table and when i have stored
I want to compute how many times my computer can do counter += 1
Given an array A[1..n] , we want to compute another array B[1..n] such that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.