Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    18

    Unanswered: oracle date to unix timestamp conversion

    Hi..

    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 ?

    Code:
    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;
    Please help me ...

    Thank you,
    Baharin

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >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.

Posting Permissions

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