Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL NEW_TIME Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: NEW_TIME

Definition:
The Oracle PL/SQL NEW_TIME function converts a datetime value in a timezone to a datetime equivalent in another timezone. It accepts date input, current timezone and target timezone as its parameters.

Example Syntax:

NEW_TIME(date, timezone 1, timezone 2)


Timezone 2 is the current timezone of input Date. The function returns its equivalent in timezone 1. Note that NLS_DATE_FORMAT parameter must be set in the 24 hour time format before using the NEW_TIME function.

Example Usage:

The SQL example below returns the PST timezone equivalent of date in the EST timezone.

SELECT NEW_TIME(TO_DATE('12-14-10 12:26:34', 'MM-DD-YY HH24:MI:SS'),'PST', 'EST')  "Time in PST"
FROM DUAL
/

Time in PST
--------------------
14-DEC-2010 15:26:34



Related Links:

Related Code Snippets:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 63 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?