SimpleDateFormat rolling 1 hour too early for Fall 2003?

Hey all...
My question deals with the SimpleDateFormat object, more specifically given a time in NY ( that rolls from EST to EDT and back to EST in the fall)
Currently the following code (borrowed from a previous post) works perfectly for the Spring transition from EST to EDT, i.e. GMT-5 to GMT-4 on April 6. But it seems to roll back to GMT-5 at 1AM for October 26, as opposed to 2AM as I would expect. Does anyone know why this happens?
any help would be appreciated.
thanks.
import java.util.SimpleTimeZone;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import java.util.TimeZone;
import java.io.*;
public class GMTTimeUtil {
     public static final SimpleDateFormat sdf =
     new SimpleDateFormat( "yyyyMMddHHmm" );
     static BufferedReader in = new BufferedReader( new InputStreamReader( System.in ) );
     public static final SimpleDateFormat formatter =
     new SimpleDateFormat( "yyyyMMddHHmm" );
     static {
          sdf.setTimeZone( TimeZone.getTimeZone( "GMT+00:00" ) );
     public static void main( String[] args ) {
          Date param = null;
          System.out.println( "Enter a time: (yyyyMMddHHmm )" );
          try {
          param = formatter.parse( in.readLine() );
          System.out.println( "The time in Greenwich based on input is: " + getGMTTime( param ) );
          } catch( Exception e) {
     public static String getGMTTime( Date param ) {
          System.out.println( "The time passed into this function is:" + param );     
          return sdf.format( param );

This may be of interest.
import java.util.*;
import java.text.*;
public final class EST_EDT{
public static void main(String[] args) throws java.lang.Exception{
  java.text.SimpleDateFormat form = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm z");
  TimeZone zone = TimeZone.getTimeZone("America/New_York");//behavior is different when SimpleTimeZone zone = new SimpleTimeZone(offset,ID);
  System.out.println(zone.getID());
  GregorianCalendar cal = (GregorianCalendar)Calendar.getInstance(zone);
  cal.setTimeZone(zone);
  form.setCalendar(cal);
  long t0 = 1067144400000L;
  System.out.println(t0);
for(int j=0;j<12;j++){
      cal.setTimeInMillis(t0+j*10*60*1000L);// increment of 10 minutes
      System.out.println(form.format(cal.getTime()));
}

Similar Messages

  • Since installing Snow Leopard on my iMac, my incoming mail on Entourage is showing sending time nine hours too early on incoming messages. How do I adjust the time in Entourage? Thanks

    Since installing Snow Leopard on my iMac, Entourage is showing sending time nine hours too early on incoming messages. How do I adjust the time in Entourage? Thanks

    Sylvia,
    There is a Office for Mac Product Forums, if now one here is able to answer I'd recommend posting on that forum.

  • Why are some photos on camera roll but not in photo stream. Unable to backup as camera roll size is too big for free 5gb.

    Why are some photos on camera roll but not in photo stream. Unable to backup as camera roll size is too big for free 5gb.

    I assume you have Photostream on, correct?
    In order for the photos to be moved into Photostream, you must exit the camera app, and be on a wifi connection.  Both of these criteria must be met before the sync occurs.

  • Some calender appointments show one hour too early after sync

    when I sync my calendar from ical to my iphone, some appointments (that are repeated weekly) are shown on time and some one hours to early. This occurs with all apointments dated after november 1st (switch from summerclock to winterclock in Europe). I supposed it has something to do with timezone. I had this problem on my mac as well, so I turned timezone support on, and the problem was resolved. But the problem remains on my iPhone. And strange enough, some appointments are shown correctly on the same time before november 1st, but some of them are shown too early. I use my calender and iCal MobileMe sync all the time and need it for all my apointments. But now it's not reliable.
    Can someone offer help?
    thank you.

    I found this solution on another discussion (http://discussions.apple.com/thread.jspa?messageID=8399991&#8399991) It worked for me!
    On my iPhone I went to Settings, Mail/Contacts/Calendars, All the way at the bottom is a selection for Time Zone Support, it was still listed as GMT-4 which would be correct for DST. I turned Time Zone Support off and then back on again and it changed to Washington, DC (GMT-5). All of the items on my Calendar were then correct.

  • Too early for the retina, too late for the non retina? Which one?

    Hi everyone,
    Sorry for yet another "Which MBP should I buy" post but I have read through all the of the discussions I can find on this topic as well as around the web.
    I am a digital designer who is currently using a PC only because up until now I have never been in the financial position to transition over to Mac.
    I am currently trying to decide between getting a a 15" Mac Book Pro or 15" Retina Mac Book Pro.
    15-inch: 2.6GHz
    2.6GHz quad-core Intel Core i7
    8GB 1600MHz memory
    750GB 5400-rpm hard drive1
    Intel HD Graphics 4000
    NVIDIA GeForce GT 650M with 1GB of GDDR5 memory
    High res anti-glare screen
    versus:
    15-inch: Retina display
    2.6GHz quad-core Intel Core i7
    8GB 1600MHz memory
    512GB flash storage1
    Intel HD Graphics 4000
    NVIDIA GeForce GT 650M with 1GB of GDDR5 memory
    I will be using Adobe CS6 Photoshop, Illustrator, Flash and Dreamweaver sometimes all at the same time. I occasionally have a video project where I will be using Premiere and After Effects. I am also looking into upskilling myself and becoming versed in at least basic 3D modelling. I am looking at a MBP because portability is important.
    Given my job, going retina seems like a no brainer but I have a few concerns:
    Speed, processing power - which will suit my needs?
    This is an investment for me, I want it to last at least 3-4 years:
    Is getting a standard MBP now just too late and bidding in the past?
    Will resale of a standard MBP suck in 3-4 years?
    In 3 years time will I need an upgrade, and if so, how will I even do this with a virtually unupgradeable (from what Ive read) Retina MBP?
    About 80% of the time I plan on hooking up the MBP to a Thunderbolt display - whats the point in a Retina?
    If I don't get a Retina and I need to start designing Retina graphics, will I be faced with added dificulty because I use standard MBP?
    Is it realistic to assume Retina graphics won't become mainstream for 3-4 years allowing me to bide my time with a standard MBP, upgrading to a Retina later?
    At work I use a 2-3 year old iMac and the screen is already magical compared to my PC and it seems to do fine for me. I've been in store and played with both and I am genuinely confused. I just feel like getting a standard MBP is like jumping on a train when it's already reached it's destination.
    Budget wise I can afford the base level Retina MBP I outlined above but if I can save money, that'd be ideal. Being me I will automatically chose the best possible solution but I need to be rational about my needs. Someone please help, I just want a Mac!
    Thanks in advance, any help is much appreciated

    kytim wrote:
    I need to be rational about my needs.
    In general
    Retina cannot upgrade RAM.  Storage can be upgraded, but more $ than upgrading the non-Retina unit.
    Non-Retina unit can upgrade RAM  base-4 GB to 16 GB for about $85 (cf. OWC.)  HD can be replaced with SSD or larger HD.   
    Therefore lack of "upgradability" in Retina
    No optical drive in Retina.
    The non-Retina has  Ethernet and FireWire ports, and a slot for a secure cable- the Retina  none of these ports.

  • Is it too early for someone to reccomend a build with one of the new Sandy Bridge CPUs?

    Hi all I need to build a new PC and was told to wait until the new Sandy Bridge CPUs were out.
    This will be my first build but I'll have some help from my brother putting it together.
    I'm coming from working in CS3 on Vista 32 and want to build a PC to run Windows7 64 and CS5.
    As for a monitor I think I'm going to get a NEC MultiSync EA231WMi 23". The reason being it is a cheap IPS. The only other one I was looking at is a ViewSonic VP2365wb but the NEC has better reviews. If anyone has any other recommendations for an IPS in that price range, I'd be grateful.
    For a case I'm going to go with a Silverstone SST-FT02B Fortress or a FRACTAL DEFINE R3.
    As for the guts, I'm a little lost.
    I was going to get a 60gb SSD to stick the OS on but I see Harm Millaard reccomending a Velociraptor over on this thread. I didn't know what one was but I looked it up and discovered it was a 10,000rpm 300gb hard drive that costs about $280. Is that right? Are there cheaper and smaller versions?
    As anyone any reccomendations on what other Hard drives I should get and what RAID I should use? My budget for the whole build is mid range I suppose.
    So that brings me to the CPU, GPU and MOBO.
    Does anyone know enough about the new Sandybridge CPUs to reccomend one and which motherboard I shoud get? Do I need a seperate GPU still. People are talking about it having an integrated GPU.
    I suppose I would like to have 12gb of RAM with an option to upgrade to 24. I initially thought 8gb would suffice but people on here seem to be using 12 or 24.
    Thanks for any advice.

    common sense Harm,
    our not oced Sandy bridge ranked 13th beating any stock processor. (for some reason you have it listed as OCed)
    remove the absurbly overpriced Xeons that makes it 8th
    remove every OCed processor its now #1.
    and its #1 without the absurd 8-12 drive raid arrays... which most people have no need for.
    for the average user your recommendation like mine was the 950 stock 950 which ranks 40th is severaly beat by the 2600 not oced..
    so your replacement recommendation should be as mine is, the 2600 over the 950 all day long..
    anything less you are arguing with your own bencmark?
    but just for giggles i am having Eric resubmit with an SSD OS and a 8 drive raid the OCed to 4.7GHz system.
    Scott
    ADK

  • Too early for tickets like this

    Ask him if he's one of these anti-vaccination kooks :p

    EvanAlmightyyy wrote:
    Honestly we do scan and open suspicious attachments for users, but only after they answer basic questions such as. 
    Do you know this person?
    Are you sure? The names change throughout the email.
    Why would they email a shipper about Sales?
    Are you stupid?I think we actually should have a training session for this, as simple as it sounds, they still don't get the logic. One user called me the other day because she got an email from a vendor we know, but wasn't expecting anything from, with just a link to "Google Drop Box" and the almost perfect Google branding on the e-stationary said Copyright 2014. I don't know how to train people to look for details like that. I don't think you can train common sense.

  • When I use my book mark menus they closs too early for me to select a bookmark

    I have quite a lot of bookmarks and when I open a bookmark menu and move the mouse pointer to select a bookmark it frequently closes before I can make the selection.

    Are you opening the side bar, or the Main Bookmarks Manager?
    Press the '''Alt''' or '''F10''' key to bring up the tool bar. Then select
    '''Bookmarks'''. Hot key is '''<Control>''(Mac:<Command>)''<Shift> B.'''

  • Begin&End-Dates being set 1 day too early for infotypes 208

    Hi Gurus,
    When an employee is withdrawn SAP is updating IT208 & IT209 with the wrong date.Could some one please help me in knowing the link between the employee withdrawn date and the infotypes dates?where do we link infotype 0000 with the tax infotypes

    Hello Gbkrreddy,
    Please, check the dynamic action in Table V_T588Z.
    Kind regards,
    Graziela

  • Dimension member listings too large for excel 2003

    Hi All,
    I have a design issue, using BPC 7.0.112 on SQL 2005, where I want to hold a large number of dimension members which currently exceeds the excel 2003 65,000 row limit. Moving to 2007 is not an option.
    Aside from the question, why does the client need to hold so many members, does anyone have any suggestions or previously used solutions to this problem?
    In previous software I've used, (Business Objects Planning), my approach would be to detach the front end xls from the backend dimension table. This needed a significant amout of vba code but allowed the application to use the dimension table in the usual way. The downside, however, being that properties and groupings could then not be maintained through the front end.
    Has anyone used this approach? Whats the impact on the application?
    Many thanks
    Phil

    Hi,
    I have successfully saved/processed a dim workbook with multiple sheets, (using relatively few members on each sheet, 8,000 & 50), however, when now loading some high volumes, 20,000 on each sheet, BPC consistently fails to save the dim member sheet.
    "The underlying connection was closed: Could not establish secure channel for SSL/TLS.
    Cannot save member sheet to the server; do you want to save it to the local machine?"
    I am using a VPN connection to the clients servers so am wondering if this a bandwidth problem? The most I have managed to save and process is about 18,000 members.
    Does anyone have any suggestions as what else is causing this failure. Is the reference "could not establish a secure channel for SSL/TLS" pointing at some sort of timeout on the server?
    Many thanks

  • Remember Reminders are firing too early

    Hello all.
    My remember reminders are firing exactly one hour too early. Calendar reminders and alarm clocks are fine but any reminder for a task created in the remember app is one hour premature. This is very annoying. Has anyone else met this and if so how to resolve?
    I just updated to 10.2.1.2941 and hoped it would help but it hasn't.
    Colm

    Hi,
    Bumping this one in hopes!
    This one is a huge show-stopper as _nobody_ will be happy with the potential for losing the terminal three seconds of their adverts upwards of half the number of times they are played!
    Seriously, am I the only one to have noticed this?
    G

  • Can't open a document I created an hour before with Pages 5.0.1; get message saying my Pages is too old, for me to download 5.0.1

    Can't open a document I created an hour before with Pages 5.0.1; get message saying my Pages is too old, for me to download 5.0.1

    You have 2 versions of Pages on your Mac.
    Pages 5 is in your Applications folder.
    Pages '09/'08 is in your Applications/iWork folder.
    You are alternately opening the wrong versions.
    Pages '09/'08 can not open Pages 5 files and you will get the warning that you need a newer version.
    Pages 5 can open Pages '09 files but may damage/alter them. It can not open Pages '08 files at all.
    Once opened and saved in Pages 5 the Pages '09 files can not be opened in Pages '09.
    Anything that is saved to iCloud is also converted to Pages 5 files.
    All Pages files no matter what version and incompatibility have the same extension .pages.
    Pages 5 files are now only compatible with themselves on a very restricted set of hardware, software and Operating Systems and will not transfer correctly on any other server software than iCloud.
    Note: Apple has removed over 90 features from Pages 5 and added many bugs:
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Archive/trash Pages 5, after exporting all Pages 5 files to Pages '09 or Word .docx, and rate/review it in the App Store, then get back to work.
    Peter

  • Is the ipod shuffle or nano good for exercise if you just use the clip on the unit, and connect to your shorts?  if so, does it feel like it's too loose, might fall off?

    is the ipod shuffle or nano good for exercise if you just use the clip on the unit, and connect to your shorts?  if so, does it feel like it's too loose, might fall off?

    I often use my shuffle while exercising, cleaning, and just generally going about my day. Never once has it come unclipped exept for when I got the earbud cord caught on something and got said earbuds yanked out of my ears. I have permanently solved that problem by simply running the cord under my shirt. Works like a charm! I can't answer you about the nano, though I'd say it has a higher likelihood of coming off as it is a bit heavier.

  • Ever since I got the new update 5.1 my iPod's been dying faster. It used to last for at least 3 hours, now it won't even last one hour and dies for no reason(even when it's in sleep mode, and not in use) What's wrong with it? Is it the update? lagging too

    Ever since I got the new update 5.1 my iPod's been dying faster, even after I charge it. It used to last for at least 3 hours, now it won't even last one hour and dies for no reason (even when it's in sleep mode, and not in use) What's wrong with it? Is it the update? It's lagging as well..

    Some Users have Reported that a  Restore as New  has helped Resolve issues...
    Backup and Set Up as New Device
    http://support.apple.com/kb/HT4137

  • Chapter Markers End Jump Too Early-Problem

    Folks, I am using DVDSP 4 and my chapter markers keep stopping too early from the burned DVD. When I play the Video_TS folder using Apple DVD player all is well. When I burn it and play it on a standard DVD player, all the chapter markers end jump earlier than they should - cutting off my full credit rolls on my video track.
    All of my chapter markers came from Final Cut Pro where I initially made them.
    Please advise.

    Make sure you test this on more than one player if it is a "for real" project of replication or duplication. All players are not created equal and there are the real weird things that may show up on only one or two players, but you need to make sure. You may want to try the other methods and see if it helps on the problem player just for fun. (Yeah, I know does not sound like much fun, but it is sort of interesting I guess )

Maybe you are looking for

  • Focus assist light wont turn off

    This is the second time this has happene d and I am really frustrated.  I placed my new Nokia 1020 in an arm carrier while at the gym and at the end of the workout, the focus assist light was on and I could not turn it off. The pressure of the spande

  • Maintanance Certificate for ECC 6.0

    Hi Experts I need to apply maintanance certifcate for ECC 6.0 component, I gather we should deploy the certificate with Solman. Can anyone please let me know the procedure Thnaks Hari..

  • Switch statement with println() for enum

    Hi, I have this exercise maybe you could help with: I have to create an enum class and then print out a description of each of the values from a switch. This is what I've done.. enum PaperCurrency {      FIVE, TEN, TWENTY, FIFTY, ONE_HUNDRED, TWO_HUN

  • Regarding ALV sort & summation

    Hi    I want to do sort & summation in ALV programatically. Can anyone provide me the sample code. Ponits are assured for helpful answers. Regards, kumar

  • How to get labVIEW to recognize DaqBOOK 2000A from Iotech

    I've just setp my hardware and software. Does anybody now how to get LabView to start "talking" with this IOTech product, DaqBook 2000A or similiar IOTech hardware?