0

I want to add a column to my table where I have a date (DD-MM-YY) to a unix timestamp. Tried several things but none deliver the result I am looking for. In the end I would like

Column 1 03-06-21
Column 2 1622671200

Fredro
  • 7
  • 1
  • What did you try? – Wernfried Domscheit Jun 03 '21 at 10:04
  • Hi @WernfriedDomscheit. I have SELECT (enddate - to_date('01-01-70','DD-MM-YY')) * (86400) as dt FROM TABLE; or similar select (enddate - date '1906-01-01') * 24 * 60 * 60 unix_style from TABLE; This just not gives the right result. – Fredro Jun 03 '21 at 10:11
  • Unbelievable, did you never hear about the [Y2K-Problem](https://en.wikipedia.org/wiki/Year_2000_problem)? Have a look at `SELECT to_char(to_date('01-01-70','DD-MM-YY'), 'YYYY-MM-DD') FROM dual` You also should consider that Unix epoche is based on UTC. – Wernfried Domscheit Jun 03 '21 at 11:50

0 Answers0