Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to set Date/Timestamp
nagendra rai <nagendra.rai_at_Sun.COM> wrote:
> I am trying to set and get timestamp from oracle by using
>JDBC. I want to read the timestamp in UTC. I am using a calendar
>havin timezone UTC. It is not working. Could somebody help me
>by providing some information on how to set and get dates to data database.
Look at the TO_DATE and TO_CHAR format functions in the Oracle 8i SQL Reference manual (available in both HTML and PDF versions usually with your Oracle Server software installation CD's).
Simply put :
VARCHAR2 := TO_DATE( datevariable, 'dateformat' )
DATE := TO_CHAR( stringvariable, 'dateformat' )
dateformat:
yyyy for year, mm for month, dd for day, hh24 for 24 hour format, hh
for hour format, mi for minutes and ss for seconds. Various other
formats are also supported like ddd for Julian day, etc.
-- BillyReceived on Thu Mar 07 2002 - 03:34:34 CST
![]() |
![]() |