Kowshik Nandagudi
,
Ranch Hand
Dec 16, 2011 05:15:22
Hi
Can I know if my date falls in a dst? I dont want to specify the time but only the date
For example:
Claudiu Chelemen
,
Ranch Hand
Dec 16, 2011 06:22:01
Hi
You may use the inDaylightTime method on the TimeZone
Cheers,
Claudiu
Kowshik Nandagudi
,
Ranch Hand
Dec 16, 2011 06:37:06
The above code returns false even though 30th october 2011 falls under DST
Claudiu Chelemen
,
Ranch Hand
Dec 16, 2011 06:44:03
Well, what's your timezone id ?
Claudiu
Kowshik Nandagudi
,
Ranch Hand
Dec 16, 2011 06:58:45
TimeZone ID is "Europe/London"
Claudiu Chelemen
,
Ranch Hand
Dec 16, 2011 07:26:47
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
Campbell Ritchie
,
Marshal
staff
Dec 16, 2011 07:43:36
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.
Kowshik Nandagudi
,
Ranch Hand
Dec 16, 2011 08:16:54
but i dont want to specify the time. just need to know if dst applies on that day
Joanne Neal
,
Rancher
Dec 16, 2011 08:24:09
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.
Winston Gutkowski
,
Bartender
staff
Dec 16, 2011 08:56:08
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