RE: Timestamp and epoch

"Zabach, Elke" <[email protected]>
Newsgroups gmane.comp.db.maxdb
Message-ID <[email protected]>
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/[email protected]
> 
> 
> 

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.