I have a table with a field of type bigint. This field store a timestamp. I want to date format the field like this :
to_char( bigint_field,'DD/MM/YYYY HH24:MI:SS')
I get the following error :
ERROR: multiple decimal points État SQL :42601
I have a table with a field of type bigint. This field store a timestamp. I want to date format the field like this :
to_char( bigint_field,'DD/MM/YYYY HH24:MI:SS')
I get the following error :
ERROR: multiple decimal points État SQL :42601
I did it like this:
the result looks like this:
you also can use this in you select statemant, just exchange the number with your database colunm.
Step by Step Explanation:
This will create a string like this:
now we can easiely convert this into a timestamp:
Result will look the same as before, but it's now a timestamp.
Also, if you use this for a command like
you might end up with timstamptz (timestamp with time zone) instead of timestamp (timestamp without time zone). You can change it like this:
This depends on what the bigint value represents - offset of epoch time, or not.
returns