Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: convert date string to date in javascript step

  1. #1

    Default convert date string to date in javascript step

    I have get the date string from a list for csv file but there are two formats of these files about the date field .In order to let's the step to read this field ,I use the type string,then I want to convert this string to date field . When I use the javascript to convert it.I found the function "str2date" have errro, and when I used the 'Date" class. only can convert the first file's date string. How can we convert the two kinds of format date string to date? And how to use the str2date ?

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

    Default

    Use the 'Date' class, convert to the date using your first format, if that fails use the second format ?

    Regards,
    Sven

  3. #3

    Default

    Quote Originally Posted by sboden View Post
    Use the 'Date' class, convert to the date using your first format, if that fails use the second format ?

    Regards,
    Sven
    Hi,Sven,
    I'm not clear about your mean ,yeah, I can convert the 'dd/MM/yyyy' by Date 's class ,but the another format 'yyyy-MM-dd' change to the same date '1970/014/01' . Can you show me you code ? Sorry I'm a newbie to pentaho. But in this two month ,I should become the expert in pentaho not only in kettle ,So time is limited

Tags for this Thread

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.