dst

Synchronize dates between Java and C++

I have an application that runs on a device that is not connected to the internet. The OS is Windows XP. There're C++ module and Java module that interact over a socket. The Java part needs to get a file from the C++ part according to its date and time. When DST switch arrived they stopped working. It seems that the C++ ignores DST becau...

How can I modify the Daylight Saving Time of my timezone on Windows Mobile?

My phone, running Windows Mobile 6, has suddenly decided to drop an hour every time I hook it up to my PC. I tried playing with the timezone settings in the Control Panel, to no avail. I've come to the conclusion the heart of the problem is in the Daylight Saving configuration of my timezone. I could not find any utilities to let me ed...

How to get timezone hour offset and account for DST with PEAR::Date?

I am trying to get the offset hours from UTC, given a summer date. My system time is set to America/Los_Angeles. I have the following: require_once("Date.php"); $dateTZ = new Date_TimeZone('America/Los_Angeles'); echo $dateTZ->getOffset(new Date('2009-07-01 12:00:00'))/1000/60/60; This prints '-8'; shouldn't it show '-7'? echo $da...

Determine Whether Daylight Savings Time (DST) is Active in Java for a Specified Date

I have a Java class that takes in the latitude/longitude of a location and returns the GMT offset when daylight savings time is on and off. I am looking for an easy way to determine in Java if the current date is in daylight savings time so I can apply the correct offset. Currently I am only performing this calculation for U.S. timezon...

Converting old and new local times to UTC under Windows XP/Server 2003

My application converts past and present dates from local time to UTC. I need to ensure I will honor any future DST updates to Windows while still correctly handling past dates. The application is written in C++ and is running on Server 2003. Options I've researched: gmtime() and localtime() are not always correct for past dates bec...

UTC and Daylight savings scenario.

I am using UTC to store data and time values in the DB. The values are converted to localtime on the client or per client timezone. I stepped on these scenarios from the MSDN article, where displaying the time from UTC seems to pose issues during daylight savings. Someone living on the east coast of the United States types in a val...

Why does this rails query behave differently depending on timezone?

I have a rails time-based query which has some odd timezone sensitive behaviour, even though as far as I know I'm using UTC. In a nutshell, these queries give different answers: >> Model.find(:all,:conditions=>['created_at<=?',(Time.now-1.hours).gmtime]).length => 279 >> Model.find(:all,:conditions=>['created_at<=?',(Time.now-1.hours)])...

POSIXct times around DST?

I want to subtract 1 day from a POSIX date and end up at the same time around DST. For example, when I add a day: > as.POSIXct('2009-03-08 23:00:00.000') + 86400 [1] "2009-03-09 23:00:00 EDT" But when I go past, it offsets: > as.POSIXct('2009-03-08 23:00:00.000') - 86400 [1] "2009-03-07 22:00:00 EST" What's the best way to deal ...

Get Daylight Saving Transition Dates For Time Zones in Java

I'd like to know the simplest way, in Java, to get a list of dates in the future where daylight savings time will change. One rather inellegant way to do this would be to simply iterate over a bunch of years' worth of days, testing them against TimeZone.inDaylightTime(). This will work, and I'm not worried about efficiency since this wi...

control panel date&time is considered while using "new date()" javascript function.

Hi, I am getting a client date in javscript function using "new date()" object. But this object is considering the properties set for Date&Time control in the control panel of the system. For example, If I check the check box of Date&Time control of the system (control panel) "Automatically adjust clock for daylight saving changes", t...

How to tell if a timezone observes daylight saving at any time of the year?

In PHP, you can tell if a given date is during the Daylight Savings Time period by using something like this: $isDST = date("I", $myDate); // 1 or 0 The problem is that this only tells you whether that one point in time is in DST. Is there a reliable way to check whether DST is in effect at any time in that timezone? Edit to clarif...

How to preserve accurate time (daylight saving) for a web application?

Okay this may be a simple question but I have yet to come with a working solution, so to anyone who can help thanks in advance. Consider the following scenario: We have a web-application running on MySQL (if you need to know) that is time dependent say an application that sends an email at the user specified time. Now every user has set...

MySQL datetime fields and daylight savings time -- how do I reference the "extra" hour?

I'm using the America/New York timezone. In the Fall we "fall back" an hour -- effectively "gaining" one hour at 2am. At the transition point the following happens: it's 01:59:00 -04:00 then 1 minute later it becomes: 01:00:00 -05:00 So if you simply say "1:30am" it's ambiguous as to whether or not you're referring to the first tim...

Querying record by date (01 may 1916) on Oracle using Java/EJB 2.x

I have an EJB 2.1 entity bean that queries a "date of birth" column in an Oracle table. The column in the database is of type DATE. The query works without problems except for one specific date: 01 may 1916. This has something to do with daylight savings. Oracle stores the date as: 5/1/1916 1:00:00 AM, while the time of all other dates...

Java Date, render with specific daylight mode

I have a Java Date that is from this summer during daylight savings time. For example: Jun 01, 2009 06:00 AM PDT My question is, how do I display this date as my local time zone and current daylight savings mode (in my case Pacific Standard Time)? Jun 01, 2009 05:00 AM PST Java's Date.toString() and SimpleDateFormat displays ...

What is the proper way to disable daylight savings auto-adjustment on WinCE?

I want to programatically uncheck the "automatically adjust the clock for daylight savings" check box from a compact framework application running in WinCE. Google searches indicate that you can do this in Windows by setting the DisableAutoDaylightTimeSet value under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInfo...

Convert a summer date to utc in the winter?

The function mktime takes a struct tm as argument. One of the members of struct tm is tm_isdst. You can set this to 1 for wintertime, 0 for summertime, or -1 if you don't know. However, if during winter, you try to convert 2009-09-01 00:00, mktime fails to see that although it is currently winter, the date you are converting is summert...

Check for daylight saving time with WMI on Vista/Win7

How do I find out if the computer I'm on has daylight saving time in effect? (preferably using WMI) According to this article at TechNet, I could query SELECT DaylightInEffect FROM Win32_ComputerSystem, but the property DaylightInEffect is not supported on Vista or Win7. As my program will run on various systems (XP, Vista, 7), I would ...

Efficient algorithm for determining if a date is in DST

I'm looking for a better than O(n) algorithm to determine if a date in the future will have daylight savings time applied (and how much). Given a year, month, day, hour, minute and time zone (and a copy of the Olsen Time Zone database) how does one efficiently determine if that date will be in DST? I'm looking for the algorithm, not a ...

javazic timezone format

Where can I find documentation about the binary data format outputted by javazic (the files shipped in Debian's tzdata-java package)? The standard format used in /usr/share/zoneinfo has no explicit concept of daylight savings time versus standard time. It only knows about a timezone having different offsets from UTC at different times o...