DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2000
    Portsmouth, NH, USA


    Greetings, is there a timezone parameter when using wither to_char or to_date??

    I couldn't find one in any documentation.

    I want my output to look like this:
    Thu March 22 14:56:06 EST 2001

    so far I have:
    select to_char(sysdate, 'Dy Month DD HH24:MI:SS YYYY') from dual;


  2. #2
    Join Date
    Sep 2000
    You've probably already thought of this, but ...

    If you know the timezone the server is in, hardcode it :-)

    Or, since sysdate is the server date/time, perhaps you get the entire date/time string at the OS level (assuming your on the server) and pass it into your SQL as a parameter (in Unix, "date +'%a %B %d %H:%M:%S %Z %Y'" would return the string you're after)

    Or, if you're doing this interactively, either do a "!date +%Z" or "!env|grep ^TZ" to get just the timezone.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.