on 2016 Jun 01 1:47 PM
Hi everyone,
I would like to know if there is a way to convert a datetime value stored in a variable to unix/epoch format.
I found several ways to do the opposite, but found nothing helpful on how to achieve this.
A script in a job contains a variable, say $datetimevar.
This is loaded using SQL to hold a value such as '2016/01/06 18:12:00'.
I would like to know if there is a way we can convert this value to epoch/unix format and hold it in, say $datetimevar_unix.
Any help would be appreciated.
Regards,
Sid
Request clarification before answering.
date_diff( to_date('19700101','YYYYMMDD'),sysdate(),'SS')
replace sysdate() with any datetime value you need
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not anymore, there is no date_diff function in 2025. https://help.sap.com/docs/SAP_HANA_PLATFORM/4fe29514fd584807ac9f2a04f6754767/f12b86a6284c4aeeb449e57...
You can use `SECONDS_BETWEEN('1970-01-01 00:00:00', TO_TIMESTAMP(<YOUR_COLUMN>))` instead.
User | Count |
---|---|
78 | |
12 | |
8 | |
8 | |
7 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.