Convert A String To A Timestamp
If you have a string that represents a point in time, there are a couple ways that you can convert it to a PostgreSQL timestamptz
value.
If the string is in ISO 8601 format, then it can be simply cast to timestamptz
.
A more general purpose approach is to use the to_timestamp
function.
The first argument is our string-to-be-converted in whatever format. The second argument is another string describing in what format that string is.
Note: Both of these approaches produce a timestamptz
value.
Last updated