Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Location
    Columbus, OH
    Posts
    69

    Unanswered: DB2 Epoch function

    DB2 8.2
    AIX 5.2


    I've got a trigger which insert a current timestamp in DB2 Timestamp format but I want to have a trigger which inserts current EPOCH time. I haven't been able to find a db2 function for it, so was looking for the least hack way to do it.

    Thanks,

    Charlie

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    DAYS or JULIAN_DATE functions.
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    See if this helps:
    Code:
    db2 values bigint(days(current date) - days('1970-01-01'))*bigint(86400) 
    + midnight_seconds(current_timestamp - current_timezone)
    ---
    "It does not work" is not a valid problem statement.

Posting Permissions

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