Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: converting to date problem

  1. #1
    Join Date
    Nov 2015
    Posts
    15

    Default converting to date problem

    Hi,

    pentaho di 5.4.0.1-130
    on step GetVariables when put variable value to the field of data type Date, format yyyy/MM/dd HH:mm:ss.SSSSSSSSS, I have got issue

    2015/11/15 14:24:41 - Get Variables.0 - last_update String(29) : couldn't convert string [2015/11/15 12:58:45.004000000] to a date using format [yyyy/MM/dd HH:mm:ss.SSSSSSSSS] on offset location 29

    variable actually contains 2015/11/15 12:58:45.004000000

    what's wrong?

    Mikhail

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    If that's meant to be 4 milliseconds, you'll have to cut the trailing 6 digits from the string before a Java SimpleDateFormat can be used to parse the date.
    There's no sense in a 9-digit subsecond part anyway.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Nov 2015
    Posts
    15

    Default

    thank for you answer.

    I know that 9-digit millis no sense. But this way value stores in variable, when it was retrieved from postresql db it was 2015/11/15 12:58:45.004, storing in variable tranforms to 2015/11/15 12:58:45.004000000

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    The bad formatting AFAICS is done by Kettle.
    Try to fetch a date from postgresql instead of a timestamp and you should be fine.
    So long, and thanks for all the fish.

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.