List:MaxDB« Previous MessageNext Message »
From:Elke Zabach Date:January 15 2007 3:45pm
Subject:RE: Timestamp and epoch
View as plain text  
Michael Jürgens 
> 
> Hi,
> 
> is there any sql function to convert a timestamp into an 
> epoch (seconds 
> since 1970 ...) and vice versa?
> 
> regards,
> 
> Michael
> 

There is no such function pre-defined.
If you really need it (and not only are used to use it), then
a user-defined-function calling

select 
86400 * (datediff ( <your timestamp>, '19700101000000') +
 3600 * hour      ( <your timestamp> )                  +
   60 * minute    ( <your timestamp> )                  +
        second    ( <your timestamp> )
into :outputparam from dual

may help

Elke
SAP Labs Berlin

> 
> -- 
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:    
> http://lists.mysql.com/maxdb?unsub=1
> 
> 
> 
Thread
Timestamp and epochMichael Jürgens11 Jan
  • RE: Timestamp and epochElke Zabach15 Jan