Skip to content
Discussion options

You must be logged in to vote

By "convert" do you mean format for display?
Or change the underlying datatype, and migrate the existing data?
Postgres has native datetime types, and you should preferably use those when storing dates, rather than integers which seems to be what you are doing here (please correct me if I am wrong). Therefore if possible I would encourage you to change your schema to use the appropriate data type.

Should you decide to keep using integers to store timestamps, you have a few options to display them in human readable format.
The simplest is to handle it on the front end: javascript date objects can be created using unix timestamps, and then displayed in a human readable format.

// in practic…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@darw82
Comment options

@BenoitRanque
Comment options

@darw82
Comment options

@BenoitRanque
Comment options

Answer selected by BenoitRanque
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
General
Labels
None yet
2 participants