Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Unix/Epoch Time ?

  1. #1
    Join Date
    Mar 2006
    Posts
    170

    Cool Unix/Epoch Time ?

    Hi All,

    I'm having issues with converting a date coming in from CSV Input as a String to be Unix/Epoch Time.

    I'm using the following in Ver 3.2.3's User Defined Java Exp step:

    new Long(new java.text.SimpleDateFormat("yyyyMMdd").parse(work_order_effective_date.toString()).getTime()/1000).toString()

    If the incoming work_order_effective_date = 20090130 the above stmt outputs it as 1233298800

    When I use the following URL http://www.onlineconversion.com/unix_time.html to verify the output it shows that it is:

    Fri, 30 Jan 2009 07:00:00 GMT

    So the Fri, Jan 30 2009 is correct ... BUT where is it getting the 7 am ?

    Thoughts?

    Thanks

    Kent

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Timezone. Unix epoch is defined as Jan 1st 1970 UTC, not GMT.

  3. #3
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    PDI is helping you out based on your system's time zone.

    Incoming Work_order_effective_date is 20090130 -> 2009-01-30 00:00:00 MST -> 2009-01-30 07:00:00 UTC

    There is a way to tell PDI to work in UTC, but I can't remember what it is.

  4. #4
    Join Date
    Mar 2006
    Posts
    170

    Default

    Hey Matt,

    thanks again!

    Looks like the JS trick as stated in http://forums.pentaho.com/showthread...ighlight=epoch works!

    Kent

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.