Forums Register Login

day light saving

+Pie Number of slices to send: Send
Hi

Can I know if my date falls in a dst? I dont want to specify the time but only the date

For example:

+Pie Number of slices to send: Send
Hi

You may use the inDaylightTime method on the TimeZone


Cheers,
Claudiu
+Pie Number of slices to send: Send


The above code returns false even though 30th october 2011 falls under DST
+Pie Number of slices to send: Send
Well, what's your timezone id ?

Claudiu
+Pie Number of slices to send: Send
TimeZone ID is "Europe/London"
+Pie Number of slices to send: Send
I believe it looks also at the current time.
If you set the hour on the calendar to 0, will it return true ?

If I am not mistaken, DST ends at 01:00 GMT.

Claudiu
+Pie Number of slices to send: Send
 

Claudiu Chelemen wrote: . . . If I am not mistaken, DST ends at 01:00 GMT. . . .

That is correct. After 1.59am (BST) came 1.00am (GMT) on 30th October this year.
+Pie Number of slices to send: Send
but i dont want to specify the time. just need to know if dst applies on that day
+Pie Number of slices to send: Send
 

Kowshik Nandagudi wrote:but i dont want to specify the time. just need to know if dst applies on that day


From midnight until 1am it does, from 2am onwards it doesn't, between 1am and 2am I'm not sure because that hour happens twice. So the answer to whether DST applies on that day is yes and no. You'll have to decide how you are going to handle that.
+Pie Number of slices to send: Send
 

Kowshik Nandagudi wrote:but i dont want to specify the time. just need to know if dst applies on that day


What Joanne said.

If you only need to know whether most or all of the day was in DST or not, set the time to 12 noon.

Winston
Well THAT's new! Comfort me, reliable tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1477 times.
Similar Threads
DST issue with GregorianCalendar
DST & Actual Date
Current date - 10
Code to check whether a given date falls on weekend or holidays
Code to check whether a given date falls on weekend or holidays
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:32:14.