Results 1 to 2 of 2
  1. #1
    vincent_rig is offline Member
    Join Date
    May 2011
    Rep Power

    Default Calendar differences between timezones

    Hi all,

    I notice some differences when running the piece of code below in different timezones. When I run by default I get following output:

    Wed Apr 06 16:41:27 CEST 2011

    When I change my timezone to -Duser.timezone=Asia/Jerusalem and run again, I get:

    Wed Apr 06 16:50:48 IDT 2011

    I would expect to perhaps get 1 hour difference since CEST is UTC+2 and IDT is UTC+3, but I do not understand why I get 9 minutes 21 seconds difference?

    Both runs happen on the same machine with the same JDK (1.6.0_21).

    Any ideas that could help me on my way?

    Java Code:
    Calendar c = Calendar.getInstance();
    Date date = c.getTime();

  2. #2
    vanslyke is offline Member
    Join Date
    Jun 2011
    Rep Power

Similar Threads

  1. Generics Differences?
    By castiel in forum New To Java
    Replies: 2
    Last Post: 02-21-2011, 12:11 PM
  2. Boosting differences
    By belsen in forum Lucene
    Replies: 0
    Last Post: 11-24-2010, 10:26 AM
  3. Timezones
    By Shaolin in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 08-27-2008, 07:54 AM
  4. differences: AWT and Swing
    By baltimore in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 10:01 AM
  5. differences between 2 dates
    By cecily in forum New To Java
    Replies: 1
    Last Post: 08-02-2007, 06:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts