Hi Guys,
Need some help. Can you give me sample codes how to determine if my pc is on DST or not?
Thank you!
Hi Guys,
Need some help. Can you give me sample codes how to determine if my pc is on DST or not?
Thank you!
up...........
You didn't like Chip's code?
Entia non sunt multiplicanda sine necessitate
its too long and it cant read the macro
What can't read the macro?
Please Login or Register to view this content.
A B 1 FALSEA1: =IsDSTNow()
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.
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?
The Philippines doesn't use DST, does it?
How can I determine that tho?
this hould help, we're using this timezone (UTC-05:00) Eastern Time (US & Canada)
Thanks!
The US went off DST on Nov 5th this year.
so are you saying that, it's just correct that the return value is FALSE?
As opposed to what?
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!
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.
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.
Code module ModItsAboutTimeAndDate contains detailed Time Zone information in addition to ‘Standard Time’ and ‘Daylight Savings Time’ information.Please Login or Register to view this content.
Due to space limitations the code from ModItsAboutTimeAndDate is in the next post.
Lewis
Code from module ModItsAboutTimeAndDate:
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks