472,965 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,965 software developers and data experts.

Utcnow IsDayLightSaving() problem

Hello there,

I'm having a problem with Utcnow property. I'm checking the Utcnow for
IsDayLightSaving() if true or false. I'm setting the timezone to GMT
time London etc and during summer when daylight saving is applied hence
GMT Daylight time.

However the System.DateTime.Utcnow.IsDayLightSaving() always returns
false even when it is on GMT Daylight time. Whats this.. what I'm
missing?

Thanks for any insights

Jan 16 '06 #1
6 7131
Varangian wrote:
I'm having a problem with Utcnow property. I'm checking the Utcnow for
IsDayLightSaving() if true or false. I'm setting the timezone to GMT
time London etc and during summer when daylight saving is applied hence
GMT Daylight time.

However the System.DateTime.Utcnow.IsDayLightSaving() always returns
false even when it is on GMT Daylight time. Whats this.. what I'm
missing?


A UTC date-time surely *never* has daylight savings time applied to it,
by definition. That's what I'd have expected.

Jon

Jan 16 '06 #2
The strange thing is when I apply to GMT time zone on my computer and
set the time a minute before daylight savings apply and wait until the
minute passes say for example for this year it is on 01:00.... I set it
to 00:59 and wait until it applies. I see that the time would be 02:00.
So there seems to be daylight saving in the GMT Time zone. And in fact
in my code I check by System.DateTime.Now.IsDayLightSaving() and
returns true.

strange but true. Thanks Jon Skeet

Jan 16 '06 #3
If I am reading the documentation correctly, the IsDaylightSavings() ALWAYS
returns false if the 'Kind' property of the DateTime is Utc. Thus I would
think that DateTime.UtcNow.IsDaylightSavings() always returns false,
whereas DateTime.Now.IsDaylightSavings() might return true if it truly is
Daylight Savings. The 'Kind' property is new to .NET 2.0, so if you are
using 1.1 you won't see it, but it still might be there. Try using
DateTime.Now instead.

Also, Are you actually setting the time on your computer, or just setting
the timezone? I would think that your computer time must be set to a
date/time during which it is ACTUALLY Daylight Savings. We are currently
on Standard Time (DST runs from early April to late October.)

-mdb

"Varangian" <of****@gmail.com> wrote in news:1137422513.885462.241620
@g47g2000cwa.googlegroups.com:
Hello there,

I'm having a problem with Utcnow property. I'm checking the Utcnow for
IsDayLightSaving() if true or false. I'm setting the timezone to GMT
time London etc and during summer when daylight saving is applied hence
GMT Daylight time.

However the System.DateTime.Utcnow.IsDayLightSaving() always returns
false even when it is on GMT Daylight time. Whats this.. what I'm
missing?

Thanks for any insights


Jan 16 '06 #4
Thats what I'm doing, I'm actually setting on the windows datetime on
the taskbar to 26/03/2006 01:59. I thought that Utcnow is the same as
GMT Time set on the your computer which it seems is not.

Jan 16 '06 #5
Thats what I'm doing, I'm actually setting on the windows datetime on
the taskbar to 26/03/2006 01:59. I thought that Utcnow is the same as
GMT Time set on the your computer which it seems is not.

Thanks Michael bray

Jan 16 '06 #6
Varangian wrote:
The strange thing is when I apply to GMT time zone on my computer and
set the time a minute before daylight savings apply and wait until the
minute passes say for example for this year it is on 01:00.... I set it
to 00:59 and wait until it applies. I see that the time would be 02:00.
So there seems to be daylight saving in the GMT Time zone. And in fact
in my code I check by System.DateTime.Now.IsDayLightSaving() and
returns true.


Well, I'm in the UK and always pick GMT as my time zone - but
definitely apply daylight savings. In the summer we're in BST (British
Summer Time). I suspect there are two sort of parallel considerations
for GMT going on, effectively. However, UTC is a "constant" - it's GMT
without daylight savings, effectively. (Actually, I've a suspicion
there are some subtle differences in terms of leap seconds etc, but
nothing to worry about.)

Jon

Jan 16 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Steve Erickson | last post by:
I have a logger class that uses the Python logging module. When I call it within a program using the unittest module, I get one line in the log file for the first test, two identical ones for the...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which is a singleton. The client is a Web Application...
117
by: Peter Olcott | last post by:
www.halting-problem.com
0
by: James Griffiths | last post by:
Here is a report I've written about a printing problem that is being experienced by a particular company for whom I had developed a A97 system. After upgrading to Win XP and AXP, some printing...
18
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
0
by: Elizabeth Harmon | last post by:
hi All I know this has been asked propably a million times, i hope you'll indulfe one more question. I am Coding on a Windows 2000 VS.Net 2003 1.1 Box. I need to get Zulu Date/UTC/GMT which...
1
by: T-u-N-i-X | last post by:
Hey There, I'm a django developer and working on a project right now.. Last week I just discovered a new problem in Python.. Here's what I do.. (tunix@penguix ~)$ date Sal May 20 01:00:10...
36
by: Nick | last post by:
Hi there I'm trying to use the IsDaylightSavingTime property of the datetime object. The PC I am using is in GMT, DateTime.Now.IsDaylightSavingTime() returns true...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.