I believe experimental_strptime performs a similar role in Cockroach. See
experimental_strptime does not convert epoch to timestamp.
I think that casting an integer to a timestamp should interpret it as an epoch.
Also I believe that the
%s strptime directive will interpret the unix epoch in seconds.
Also why is this method name starting with
experimental is it not fully supported?
As far as that
to_timestamp call, I believe you can replace it with
1284352323::timestamp to get the same behavior.
So our implementation of
strptime is probably fine (it is inspired from C but we made an implementation which is not dependent on C) for the purpose here. The set of formatters we support is currently documented here: https://github.com/knz/strtime#supported-format-specifiers (we’ll make a doc page later) and indeed
%s is probably what you want.
We will also probably keep
strptime as non-experimental in a future release, but perhaps using a different name than “strptime”, as David explained because pg’s function of the same name works slightly differently and perhaps we can’t support the pg semantics exactly.