Daylight Saving logic

Hi,
I have to design a java application which includes time scheduled tasks. This program should run through out the year. But I have a problem with the day light saving time. According to our schedule, in april we need to set the clock 1 hour ahead and put one hour back in October.
Can anyone tell me the logic behind it!
Thanks in advance.
Chris

Why would you want to change it?
A task is either period based (every 12 hours) or
time based (11pm every day.)
If it is the first then it stll runs every 12 hours
whether DS happens or not.
If the second then why would you want it to run at
10pm rather than 11 pm for part of the year?Taking a wild guess at the OP's problem: he/she has tasks scheduled using a java.util.Timer object. This class has methods that allow you to schedule tasks that run every X milliseconds (that's the period-based kind). If you schedule a task to run every whatever number of milliseconds there are in 24 hours, then changing to or from DST makes the tasks run one hour earlier or later, because of the two days in the year that have 23 or 25 hours. In other words java.util.Timer doesn't support the time-based kind of scheduling.
Whether it's java.util.Timer or some other scheduling method, the answer is to dump it and get some scheduling method that does support time-based scheduling properly. Or to use whatever time-based scheduling methods it does support.

Similar Messages

  • Daylight Saving Time Changes in 2007 for USA

    Can anyone give me solution how to handle Daylight saving Time changes in 2007 in USA for JDK 1.3.x releases? We are using this due to some vendor dependency. We can�t upgrade to higher versions up to middle of the 2007. I would be thankful if somebody gets back to me.

    I have a similar issue where we cannot upgrade the jdk 1.1 without involving a lot of effort. If we keep the same old jdk, can someone tell me if use of Date and Calendar api will be impacted by the Daylight saving change.....provided the timezone is default and not explicitly set to EST. Also there isnt any timezone related buss logic.

  • USA Residents:  Early Daylight Saving Time *Changes*.

    Apparently, a few folks are unaware of the changes & patch because for various reasons they do not check and/or use their Software Update Control Panel.
    http://docs.info.apple.com/article.html?artnum=305056 About Daylight Saving Time changes in 2007

    I have a similar issue where we cannot upgrade the jdk 1.1 without involving a lot of effort. If we keep the same old jdk, can someone tell me if use of Date and Calendar api will be impacted by the Daylight saving change.....provided the timezone is default and not explicitly set to EST. Also there isnt any timezone related buss logic.

  • Daylight saving in the NOkia 6233 ?

    Does the Nokia 6233 support Daylight Saving ? If yes, how can I set it in my phone ?

    It doesn't do it automatically, like a PC...it isn't that clever. You need to change it yourself. Be sure to set the time zone rather than change the clock, otherwise the phone may display incorrect times for SMS messages etc.
    Chris
    6230i (the last bug-free Nokia?)
    Vodafone UK contract since 1992

  • Cisco ISE 1.2 Daylight Saving time

    Does ISE support DST change?

    Time Zone = UTC is best practice for a distributed deployment.  Also, remember that if you change the time zone on an ISE, the database is deleted!  So, set this during initial setup.  BTW, for the Eastern Time Zone in the United States, use EST5EDT in order to allow for Daylight Saving Time.

  • Date Time in Coldfusion at Daylight Saving

    Hi
    In coldfusion, I have problem creating Date Time using CreateDateTime when the daylight saving switch. For example
    CreateDateTime(2011,3,13,2,0,0) gives error.
    Also if you do like this
    DateAdd('h',1,CreateDateTime(2011,3,13,1,0,0)) gives "2011,3,13,3,0,0" ie instead of 2AM it returns 3AM. This is happening every daylight saving switch time.
    This is a bug in coldfusion?
    It should be fixed by Coldfusion.
    Thanks

    On 3/17/2011 12:39 AM, Paresh_Patel said:
    >
    When we loop through the 24 hours on daylight saving day e.g
    >
    <cfset startDate = CreateDateTime(2011,3,13,0,0,0)>
    >
    <cfoutput>
    <cfloop from="1" to="22" index="dayNo">
          <cfset startDate = dateAdd('h', 1, startDate)>
          #hour(startDate)#<br>
    </cfloop>
    </cfoutput>
    >
    This will show wrong hours (2 is missing)
    and that means you've fallen into timezone hell.

  • Oracle 11 driver causes problem in the day when the daylight saving starts

    Hi everybody,
    I'm facing a really weird problem with daylight saving stuff. So, let me explain:
    I have a table where stores some personal data, which one of the columns is a birth date.
    On this column there is a constraint like: TRUNC(BIRTHDATE) == BIRTHDATE to ensure that the is the same always.
    Now the problem starts:
    When a person is born when the daylight saving starts (+1 hour) (e.g: Belgium 22/04/1930) in our Java application
    that date is described like: Sun Apr 22 00:00:00 CEST 1923
    When the application tries to insert data into the table, it gets a constraint violation exception.
    The configuration I'm using:
    - JDK 6_0_21
    - Oracle driver: 11.2.0.1.0 (ojdbc6.jar)
    - Oracle database: 10.2.0.4.0
    Now the weird part: When I change back to the previous Oracle driver version (10.X), it works perfectly. I've seen this FAQ:
    http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-faq-090281.html#08_01
    and tried both solutions: Set the mapDateToTimestamp property and change from DATE to TIMESTAMP type in the table. Unfortunately, both don't
    work.
    Anybody has an idea how to solve that? (Change back to the previous version is not an option for us, since we had transactional problems with it)
    Cheers,
    Bruno

    You might want to post on ODBC

  • Conversion mapping is losing time zone data during daylight saving time

    We have a problem with conversion of Calendars to timestamp with timezone for the last hour of Daylight Saving Time (e.g. 01:00 EDT - 01:59 EDT) where it is being interpreted as Standard Time which is in reality 60 minutes later.
    We've written a JUnit test case that runs directly against TopLink to avoid any issues with WAS and its connection pooling.
    The Calendar theDateTime comes from an object called TimeEntry which is mapped to a TIMESTAMP WITH TIMEZONE field using conversion mapping with Data Type TIMESTAMPTZ (oracle.sql) and Attribute Type Calendar (java.util).
    We are using:
    Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build Patch for Bugs 5145690 and 5156075)
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    Oracle JDBC driver Version: 10.2.0.1.0
    platform=>Oracle9Platform
    Execute this Java:
    SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm z");
    TimeZone tzEasternRegion = TimeZone.getTimeZone("US/Eastern");
    Calendar theDateTime = Calendar.getInstance(tzEasternRegion);
    theDateTime.setTime(format.parse("10/29/2006 01:00 EDT"));
    Persist to the database and execute this SQL:
    SELECT the_date_time, EXTRACT(TIMEZONE_REGION FROM the_date_time), EXTRACT(TIMEZONE_ABBR FROM the_date_time), EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    FROM time_table WHERE time_table_id=1
    This provides the following results:
    THE_DATE_TIME EXTRACT(TIMEZONE_REGION FROM the_date_time) EXTRACT(TIMEZONE_ABBR FROM the_date_time) EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    29-OCT-06 01.00.00.000000 AM US/EASTERN US/Eastern EST -5
    The wrong time zone is in the database. It should be EDT -4. Let's test the SQL that should be generated by TopLink. It should look like the following.
    Execute this SQL:
    UPDATE time_table SET the_date_time = TO_TIMESTAMP_TZ('10/29/2006 01:00 US/Eastern','mm/dd/yyyy HH24:MI TZR') WHERE (time_table_id=1)
    SELECT the_date_time, EXTRACT(TIMEZONE_REGION FROM the_date_time), EXTRACT(TIMEZONE_ABBR FROM the_date_time), EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    FROM time_table WHERE time_table_id=1
    This provides the same results:
    THE_DATE_TIME EXTRACT(TIMEZONE_REGION FROM the_date_time) EXTRACT(TIMEZONE_ABBR FROM the_date_time) EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    29-OCT-06 01.00.00.000000 AM US/EASTERN US/Eastern EST -5
    Now, execute this SQL:
    UPDATE time_table SET the_date_time = TO_TIMESTAMP_TZ('10/29/2006 01:00 EDT US/Eastern','mm/dd/yyyy HH24:MI TZD TZR') WHERE (time_table_id=1)
    SELECT the_date_time, EXTRACT(TIMEZONE_REGION FROM the_date_time), EXTRACT(TIMEZONE_ABBR FROM the_date_time), EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    FROM time_table WHERE time_table_id=1
    This provides better results:
    THE_DATE_TIME EXTRACT(TIMEZONE_REGION FROM the_date_time) EXTRACT(TIMEZONE_ABBR FROM the_date_time) EXTRACT(TIMEZONE_HOUR FROM the_date_time)
    29-OCT-06 01.00.00.000000 AM US/EASTERN US/Eastern EDT -4
    The correct time zone is now in the database. Let's test reading this with the following Java:
    System.out.println("cal= " + theDateTime);
    System.out.println("date= " + theDateTime.getTime());
    System.out.println("millis= " + theDateTime.getTimeInMillis());
    System.out.println("zone= " + theDateTime.getTimeZone());
    This provides the following results:
    cal= java.util.GregorianCalendar[...]
    date= Sun Oct 29 01:00:00 EST 2006
    millis= 1162101600000
    zone= sun.util.calendar.ZoneInfo[id="US/Eastern",...]
    The TimeZone object is correct since we are using the US/Eastern regional time zone, but the millis are wrong which makes the time EST instead of EDT. The millis should be 1162098000000.
    The conversion from java.util.Calendar to TIMESTAMPTZ loses the actual offset when setting to a regional time zone. It can maintain this info by specifying it explicitly.
    The conversion from TIMSTAMPTZ to java.util.Calendar also loses the actual offset even if the correct offset is in the database.
    Has anyone else encountered this conversion problem? It appears to be a conversion problem in both directions. I know that the Calendar is lenient by default and will assume Standard Time if time is entered during the repeated 1 o'clock hour at the end of Daylight Saving Time, but the Calendars we are using are explicit in their time, so this would be classified as data corruption.
    Nik

    Opened an SR. Looks like there is a problem with conversion either in TopLink or in JDBC.

  • Switch to standard time from daylight saving causes error - iOS 7

    Hi there,
    Today (27-Oct-2013) the time was switched back from daylight saving to standard. When looking my iPhone, I noticed that although the clock correctly displays the current time, the standard weather app still uses the time according to daylight saving (i.e. showing one hour ahead) and what is more interesting, the calendar acts weirdly, showing the correct time, but placing it in the old daylight saving time, i.e. 7:46 AM is shown as a line between 8:00 AM and 9:00 AM! It is really ridiculous and it seems I cannot change these. I restarted my iphone, turned off and on again using carrier provided time, but nothing changed. Any clues?
    Using iPhone 5 and iOS 7.0.2.
    Any help is appreciated.

    Problems with time, time zones have been quite common. Clearly, my brand new, the most forward thinking smartphone has the same bug. Sometimes I wonder why Apple is unable to get basic things work? they simply don't care, that's all.
    Issue with the line materializes itself on my iCal on iMac as well
    I hope, at least alarm will go off at the right time Monday morning
    BTW:  last year when I was on trip to Chile, at one night - suddenly - out of the blue - time changed on all our apple devices.. it's bad when you've got your flight next day and don't know when to wake up weeks later I have found out information Apple did not update their list of timezone changing dates.. for couple of years...

  • Change a timestamp in one timezone to another with the DayLight Saving

    Hi Guys!
    I need to change a timestamp in one timezone to another timezone with the Daylight saving time(DST).
    I can easily convert a given timestamp to a different location timezone by the use of TimeZone class in java, but found myself unable to modify it relative to the
    Daylight saving time(DST).
    I Just want to know that the companies, that are having the International clients then, how they handle these kind of things where they need to track down the user
    activity in that client(End-User) side timezone, with that Daylight Saving Time.
    I am very new to this Daylight saving time concept so if anybody knows about it anything, then plz help me out.

    venus_goyal wrote:
    Hi Guys!
    I need to change a timestamp in one timezone to another timezone with the Daylight saving time(DST).
    I can easily convert a given timestamp to a different location timezone by the use of TimeZone class in java, but found myself unable to modify it relative to the
    Daylight saving time(DST).No you don't. All Java timestamps are stored as a "epoch time" i.e. number of millisecondsseconds since 1/1/1970 GMT.
    Conversion to and from local dates and times is done when converting between stored Date objects and String values from input or for display.
    This happens in DateFormat or Calendar, and DST information is included in the Locale information passed to either class.

  • Alarm clock, recurrence does not work after daylight saving in Sydney

    Any iphone 4 users having the same problem since daylight saving?
    It woke me up 1 hour before the set alarm time, e.g. 5.55am instead 6.55am
    The one off alarm works fine.
    IOS4.1 + Itune 10

    Use the search box before posting "new" threads.
    http://discussions.apple.com/thread.jspa?threadID=2603262&tstart=0

  • Daylight Saving Time Patch in 10.2.0.4

    Question:
    When you apply the 10.2.0.4 patch (linux-64 bit), does this patch include the daylight saving time patch that needed to be applied in earlier releases?

    I know that. I was looking for the readme file but my metalink account did not have access to it. I was hoping that the forum would fill in the gap for me.
    In this situation, I should have installed the 10.2.0.1 database, then the DST patch and then the 10.2.0.4. Instead, I got ahead of myself and did the 10.2.0.4 patch first. I was just wondering if the DST patch was included in the 10.2.0.4 by now. The good news is that I had my metalink updatred so I have access to the readme file now. I'm glad you knew the answer. Oh wait, you don't.

  • TS1638 When syncing calendar on iPhone with Microsoft Office whole day appointments get moved to double day. I am aware this may be caused by conflicts in clock, viz daylight saving time. However, Outlook seems OK and takes time from Windows time and zone

    When syncing my iPhone to Microsoft Outloook all the full day appointments become two day - 2300hrs to 2300hrs next day. Sometimes this will include a nuber of a single day of 23 hours. Looked at solutions and all point to a clock issue or a daylight saving and winter times. Outlook operating time is directly from the Windows clock that incudes the change of times for daylight saving etc. It is set for UTC Dublin, Edinburgh, Lisban, London with daylight saving included in the options. I can't see what I can do.

    When syncing my iPhone to Microsoft Outloook all the full day appointments become two day - 2300hrs to 2300hrs next day. Sometimes this will include a nuber of a single day of 23 hours. Looked at solutions and all point to a clock issue or a daylight saving and winter times. Outlook operating time is directly from the Windows clock that incudes the change of times for daylight saving etc. It is set for UTC Dublin, Edinburgh, Lisban, London with daylight saving included in the options. I can't see what I can do.

  • IPhone + Outlook, recurring meetings not adjusted for Daylight Saving (Arizona)

    Anybody else out there living in Phoenix and syncing with Outlook?
    I have an iPhone 4 running iOS 5.0.1 and I sync my calendar with Outlook 2007 running on Windows XP.  Recurring meetings that were sent from another timezone are not showing the correct time following the Daylight Saving Time (DST) change on Nov. 6.
    For example, I have a recurring meeting for Tuesdays that was originally sent to me July 26, 2011 (during DST, that is) by my customer in California.  In Outlook the time is shown as 8:00 AM Pacific Time.  During DST this meeting was shown correctly in Calendar as 8:00AM.  Today it still shows as 8:00 but should show as 9:00 (8:00 PST = 9:00 MST).
    Phone Settings:  My iPhone's time zone was originally set this morning to "Set Automatically ON" and it had selected Denver although I'm in Phoenix.  I understand that Denver and Phoenix now share the same time.  I turned "Set Automatically" off and selected "Phoenix, U.S.A." then resynced, but the appoinment above still shows 8:00.
    So how do I fix this?  I really don't want my customer to have to resend the invite just to fix an iOS bug. 

    Not sure if people are still looking at this post, but we did finally find a fix for the issue.
    In the end we figured out that one of our exchange mail box users had something faulty in their profile. By "faulty", our exchange admins attempted to move the user's mail profile from one mail store to another, but exchange returned errors when attempting to do so.
    In order to "fix" the issue we ended up deleting the mail profile completely from exchange and then recreating it from scratch - scary prospect when having to do this with someone high up the food chain... (prior export and reimport essential otherwise all data is lost)
    (the user dealt with many meetings for multiple staff, and was a common factor between all users getting the issue)
    I wouldn't call this specifically a MS issue as prior to ipad/iphones, these issues did not occur, and even while it was occuring, turning off mail on ipad/iphones meant the issue did not occur and other email clients had no issues at all
    - so it looks like something in the iphone is not quite robust enough to be able to handle a few errors
    (alternative theory: perhaps it is the iphone that created the issue in the first place??? We don't know when the issue with the actual mail account started and not enough resources to trowel through log files looking for a needle in a haystack)
    Anyway, not sure if this will help everyone with the same issue, but thought I'd share our experience

  • What is the best way to switch off Daylight Saving Time?

    What is the best way to switch off Daylight Saving Time for a DST enabled timezone?

    I've been looking through the related classes and can't seem to find a way to disable DST in any timezone. Probably because they couldn't think of a good reason to want to know what the non-DST time was during DST.
    However, you could easily compute the time without DST if that's what you need.

Maybe you are looking for