0

I am having preexisting table name 'ABC' in H2 Database.and description is,

FIELD              | TYPE                           | NULL | KEY | DEFAULT
ID                 | DECIMAL(19)                    | NO   |     | NULL
EVENT              | TIMESTAMP(23)                  | YES  |     | CURRENT_TIMESTAMP()

in 'EVENT' column I have some unix timestamps (epoch time in millisec.) data.

ID |   EVENT
1  |  1468318907575 
2  |  1468321000459 

I have no idea how this has inserted into 'DB'

My concern here is I want to convert data inside 'EVENT' into normal timestamp.

in MYSQL we have FROM_UNIXTIME function to attain this kind of scenario; But in H2 Database I am not able to find a way out...

please help me in this.

Thanks in advance !!!

Reagrds

Pert8S
  • 582
  • 3
  • 6
  • 21
  • This might help you [convert unix timestamp to H2 timestamp](http://stackoverflow.com/questions/16012138/convert-unix-timestamp-to-h2-timestamp). – Rae Burawes Jul 19 '16 at 05:53
  • i checked this one but how do i use it my case ??, i am totally new to this function.. – Pert8S Jul 19 '16 at 06:16
  • EXTRACT ( datetimeField FROM dateAndTime ) Returns a value of the specific time unit from a date/time value. This method returns a numeric value with EPOCH field and an int for all other fields. Example: EXTRACT(SECOND FROM CURRENT_TIMESTAMP) – jan_kiran Mar 19 '18 at 10:52

0 Answers0