03-13-10, 22:51 #1Registered User
- Join Date
- Jun 2009
Unanswered: oracle date to unix timestamp conversion
1. What is the command to convert oracle date to unix timestamp ?
2. What is the command to convert unix timestamp to oracle date ?
This is my conversion query, but when i convert back to oracle date in different server the time become late 1 hour. Why this is happened ?... is there any problem on my sessiontimezone or dbtimezone configuration ?
create or replace FUNCTION oracle_to_unix ( in_date IN DATE) RETURN NUMBER IS BEGIN RETURN (in_date -TO_DATE('19700101','yyyymmdd'))*86400 - TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone),1,3))*3600; END;
03-14-10, 10:50 #2Registered User
Provided Answers: 1
- Join Date
- Aug 2003
- Where the Surf Meets the Turf @Del Mar, CA
>Why this is happened ?... is there any problem on my sessiontimezone or dbtimezone configuration ?
Different server is in different timezone.You can lead some folks to knowledge, but you can not make them think.
The average person thinks he's above average!
For most folks, they don't know, what they don't know.
Good judgement comes from experience. Experience comes from bad judgement.