+ Reply to Thread
Results 1 to 4 of 4

Tricky one - Daylight Saving Time/DST/Wintertime and leap years. How to?

  1. #1
    Registered User
    Join Date
    06-08-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    35

    Tricky one - Daylight Saving Time/DST/Wintertime and leap years. How to?

    So.. here's a tricky one.

    I have furiously been trying to solve this on my own, but without any luck so far!

    Basically, I need to create a worksheet for hourly observations/time stamps that goes on for the whole of 2012 (Jan 1st - Dec 31st).
    Also, I will need a similar worksheet for 2013 and 2014... but notice, that 2012 is a leap year.

    But, how do I make Excel able to handle the one hour difference that occurs during Daylight Saving Time (DST) in the spring and again in the fall?

    Have ANYONE encountered this challenge before?

    Any help is very very welcome!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Tricky one - Daylight Saving Time/DST/Wintertime and leap years. How to?

    see if this post helps you out any?

    http://www.excelforum.com/excel-work...ving-time.html

    Edit: i found that link in excel's own help facility, an oft overlooked feature
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-08-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Tricky one - Daylight Saving Time/DST/Wintertime and leap years. How to?

    It is an often overlooked feature, yes I totally agree :-)
    However, there is another issue as well. If e.g. you have half hourly observations/time stamps - that gives you 17.520 observations.. and if you use the function of taking one day and add 1/48 the whole way down, eventually you will get a mismatch since 1/48 comes with an infinite number of decimals.
    These decimals adds up to create a time mismatch over time, for each observatoin.. and if you have 17.000+ observations, this could give some trouble..!

    Maybe the only prober solution would be to actually create a "static" worksheet, where you simply type in the date stamps manually? :D

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Tricky one - Daylight Saving Time/DST/Wintertime and leap years. How to?

    if you rounddown() to 8 decimal places, over a 24 hr period it comes back to exactly 24 hrs

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1