+ Reply to Thread
Results 1 to 18 of 18

Daylight savings time

  1. #1
    Registered User
    Join Date
    07-31-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    32

    Daylight savings time

    Hi Guys,

    Need some help. Can you give me sample codes how to determine if my pc is on DST or not?

    Thank you!

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Daylight savings time

    .
    http://www.cpearson.com/excel/DaylightSavings.htm

  3. #3
    Registered User
    Join Date
    07-31-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    32

    Re: Daylight savings time

    up...........

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Daylight savings time

    You didn't like Chip's code?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    07-31-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    32

    Re: Daylight savings time

    its too long and it cant read the macro

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Daylight savings time

    What can't read the macro?

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Daylight savings time

    Please Login or Register  to view this content.
    A
    B
    1
    FALSE
    A1: =IsDSTNow()

  8. #8
    Registered User
    Join Date
    07-31-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    32

    Re: Daylight savings time

    Hi shg,

    Where should I paste the said code?

    I tried to put it on a module and it does nothing

    Additional: I also tried the =IsDSTNow(), and it returned FALSE. Knowing that DST is still active today

    Thanks
    Last edited by cordoda; 12-07-2017 at 01:05 PM.

  9. #9
    Forum Contributor
    Join Date
    04-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    198

    Re: Daylight savings time

    should paste into a module as you said you did. It should work fine are you positive DST is still active or just turned the automatic off?

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Daylight savings time

    The Philippines doesn't use DST, does it?

  11. #11
    Registered User
    Join Date
    07-31-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    32

    Re: Daylight savings time

    How can I determine that tho?

    this hould help, we're using this timezone (UTC-05:00) Eastern Time (US & Canada)

    Thanks!

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Daylight savings time

    The US went off DST on Nov 5th this year.

  13. #13
    Registered User
    Join Date
    07-31-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    32

    Re: Daylight savings time

    so are you saying that, it's just correct that the return value is FALSE?

  14. #14
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Daylight savings time

    As opposed to what?

  15. #15
    Registered User
    Join Date
    07-31-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    32

    Re: Daylight savings time

    Hi shg,

    just to clarify, its just correct to have a result of False today since US is already in standard time. and when it comes to April (I think) it will return true? correct me if im wrong :D

    Thank you!

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Daylight savings time

    The function tells whether your computer is on DST, not if it's DST wherever you are (or aren't). If you change the date or time zone on your computer, the result may change, depending on the date and time zone.

  17. #17
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Daylight savings time

    Hi cordoda,
    There are two settings that indicate Daylight Savings Time :
    a. Is the Current Date and Time Daylight Savings Time - The True or False value returned by IsDSTNow() from shg above (in Post #7)courtesy of Chip Pearson.
    b. Will Daylight Savings Time Ever be Used - The True or False value returned by IsDaylightSavingsTimeSupported() in the code below.

    Dates and times are interesting to some of us who are numerically inclined, such as the Armageddon that was supposed to occur on January 1, 2000 or the 12 missing days in September 1752 (https://en.wikipedia.org/wiki/Calend...yle)_Act_1750).
    Why do we really need a leap year anyway? While I’m ranting, why is ‘UTC’ the acronym for ‘Coordinated Universal Time’ instead of ‘CUT’?
    I originally thought I needed to read the registry to access the Date/Time information, but then I realized that Microsoft did it for me in API function GetTimeZoneInformation() (See https://msdn.microsoft.com/en-us/lib...v=vs.85).aspx)


    The significant items in the Time Zone Information that can be used include:
    a. Daylight savings time is disabled, when the wMonth value is ZERO in the ‘StandardDate’ and ‘Daylight Date’ structures.
    b. The ‘wDayOfWeek’ value uses ZERO for Sunday, while Excel VBA uses 1 for Sunday.
    c. The wday value is the ‘week number in the Month’ for the ‘wDayOfWeek’ value. Translated into English, the 1st Sunday of the month, or the 5th Sunday of the month. If there is no 5th Sunday, then the last Sunday of the month is used.

    See the attached file for working copy of the code displayed below.

    Code module ModIsDaylightSavingsTimeEnabled contains code that indicates whether ‘Daylight Savings Time’ is ENABLED and whether ‘Daylight Savings Time’ is SUPPORTED.
    Please Login or Register  to view this content.
    Code module ModItsAboutTimeAndDate contains detailed Time Zone information in addition to ‘Standard Time’ and ‘Daylight Savings Time’ information.

    Due to space limitations the code from ModItsAboutTimeAndDate is in the next post.

    Lewis

  18. #18
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Daylight savings time

    Code from module ModItsAboutTimeAndDate:
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Convert time accounting for daylight savings [Australian (non-US) dates]
    By AdamJaffrey in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-15-2016, 11:30 PM
  2. [SOLVED] EPOCH Time Conversion to local time and daylight savings time (DST)
    By cwwazy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-23-2015, 02:14 PM
  3. [SOLVED] Calculation change for the daylight savings time change
    By icetoken in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-02-2015, 10:22 AM
  4. Convert date/time FROM UTC into EST with daylight savings.
    By mikeJ64 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-04-2015, 01:27 PM
  5. Shift Cells according to daylight savings
    By freud1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-06-2011, 05:16 PM
  6. [SOLVED] Excel VB determining if eastern standard or daylight savings time
    By Heidi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2005, 04:40 PM
  7. daylight savings time on vlookup
    By guideme in forum Excel General
    Replies: 5
    Last Post: 06-12-2005, 05:05 PM

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