Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Date format (Locale) in a SQL query

  1. #1
    Join Date
    Apr 2009
    Posts
    26

    Default Date format (Locale) in a SQL query

    Hello,

    I have an Table Input where I make a simple select.

    SELECT NAME, DATE
    FROM TICKET;

    What is the default Locale for showing the Date?

    It takes the Locale of the database or the JVM locale?

    My problem is because I want to cast this String to a Date object into Java using SimpleDateFormat.
    And if I don't know previously the Locale it fails when I try to parse it.

    Any suggestions?

    Thanks in advance.

    Regards,
    Mikel.

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

    Default

    Right click on your table input step.
    Select "Show Output Fields"

    You should see that your field DATE is already of type Date.

    How the timezone is selected, etc, is something best left to people who know the underlying code.

  3. #3
    Join Date
    Apr 2009
    Posts
    26

    Default

    Hello,

    You should see that your field DATE is already of type Date.
    No problems with this.

    My concern is about the chosen timezone to show the DATA fields.
    With US locale in MySQL it shows something like

    Code:
    Tue Aug 18 18:21:34 CEST 2009
    I think it takes from JVM, but not sure.

    Thanks.

    Regards,
    Mikel.

  4. #4
    Join Date
    Apr 2009
    Posts
    26

    Default

    update

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

    Default

    Have you tried using the "Select Fields" step to change the Meta-Data for the date to string and put the format you want on it?

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.