convert unixtime format to datetime

Amir shared this question 18 months ago
Answered

Hi all,

Is it possible to cast or convert Unixtime column to datetime in the view?

Thanks

Comments (5)

photo
1

Hi Amir,


You should be able to create a Calculated Field in the View that converts your Unix time data to a DateTime format using a function like MySQL's

FROM_UNIXTIME()

The syntax for MySQL can be found here, however, it would depend on the DBMS you are using.


Kind regards,

Simon

photo
1

It also for mssql?

photo
1

Hi Amir,


I found this Stack Overflow article that would be helpful.


I believe the equivalent would be:

Select
    dateadd(S, [unixtime], '1970-01-01')
From [Table]

Where you would not need the 'Select' and 'From table' parts of the statement.


Kind regards,

Simon

photo
1

Hi Amir,


I'm just checking in to see how you are going with your question. If you have any further questions, please don't hesitate to reach out, otherwise, I will go ahead and mark this ticket as completed.


Kind regards,

Simon

photo
1

Hi Amir,


I'm just messaging to let you know that I am marking this question as answered.


Kind regards,

Simon