Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: PDI has wrong idea of current time (DST?)

  1. #1
    Join Date
    Sep 2007
    Posts
    6

    Default PDI has wrong idea of current time (DST?)

    Hi,

    my timezone is CET (Central European Time) which is GMT+1, and currently daylight savings time is in effect which makes it GMT+2. I'm running Kettle on Linux.

    I've noticed that the time that Kettle outputs in its logs is off by one hour (Kettle outputs 6:30 when it's 7:30 here, for example). The Get System Info step also returns the wrong value when asked for "system time (fixed)". How can this be fixed/avoided?

    Edit: forgot to add, this is Kettle 2.5.1.

    Thanks,
    Sergey
    Last edited by sergey.k; 09-20-2007 at 02:30 AM. Reason: Adding Kettle version

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Well... is your Linux properly setup qua timezones... If you do a "date", do you get the same time as Kettle or a different one.

    Regards,
    Sven

  3. #3
    Join Date
    Sep 2007
    Posts
    6

    Default

    Yes, it's set up properly. Here's the output from date:
    Thu Sep 20 08:38:13 CEST 2007

    and date -u:
    Thu Sep 20 06:38:16 UTC 2007

    Kettle thinks it's 7 AM:

    # /opt/kettle/pan.sh -rep=nonexistent
    Stream not found for filename [/build_version.txt], looking for it on the normal filesystem...
    Unable to load revision number from file : [build_version.txt] : java.io.FileNotFoundException: ./build_version.txt (No such file or directory)
    java.io.FileNotFoundException: ./build_version.txt (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.io.FileInputStream.<init>(FileInputStream.java:66)
    at be.ibridge.kettle.version.BuildVersion.<init>(BuildVersion.java:65)
    at be.ibridge.kettle.version.BuildVersion.getInstance(BuildVersion.java:37)
    at be.ibridge.kettle.core.util.EnvUtil.addInternalVariables(EnvUtil.java:88)
    at be.ibridge.kettle.core.util.EnvUtil.environmentInit(EnvUtil.java:73)
    at be.ibridge.kettle.pan.Pan.main(Pan.java:51)

    07:42:05,399 INFO [Pan] Pan - Start of run.
    ...

    This makes me think Kettle forgets about DST for some reason.

  4. #4
    Join Date
    Sep 2007
    Posts
    6

    Default

    Hmm, System.out.println(new java.util.Date()); outputs Thu Sep 20 07:46:18 GMT+01:00 2007

    which means that it's Java that has no idea of DST. Now I wonder how I should fix it, but that's no longer a question for this forum.

  5. #5
    Join Date
    May 2006
    Posts
    4,882

    Default

    Let us know what you change

    Regards,
    Sven

  6. #6
    Join Date
    Sep 2007
    Posts
    6

    Default

    Okay, found it. JRE has some weird rules for determining the current time zone on Linux (see http://bugs.sun.com/bugdatabase/view...bug_id=6456628). One of the rules is "look where the symlink /etc/localtime points to". But on my system (Debian) it wasn't a symlink but a real file so a different, bogus, rule applied ("find the file with the same contents in /usr/share/zoneinfo").

    Once I changed /etc/localtime to be a symlink to /usr/share/zoneinfo/Europe/Prague, Java dates started to work correctly. The bug page says it might break some other (native) Linux programs, we'll see.

  7. #7
    Join Date
    Aug 2007
    Posts
    15

    Default Simpler and less risky solution

    Adding the following line to my shell script fixed the issue for me without the need to change the /etc/localtime to a symlink:

    export TZ=US/Eastern

    -Dipin

  8. #8
    Join Date
    Aug 2007
    Posts
    15

    Default

    Of course you should put in your actual timezone instead of "US/Eastern" which is what my timezone is.

    -Dipin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.