I am trying to convert a unix timestamp i.e. 1618876798363946752 (~April 2021) into its corresponding datetime in kdb/q. I have tried using the following function. (as per this)
q)dt:{`datetime$(1970.01.01+0D00:00:00.001 * `long$x)};
However it yields the incorrect result:
q)dt 1618876798363946752
2254.09.24T08:41:10.211
What is the general rule of thumb and associated methodology for converting a Unix timestamp of an arbitrary length to its associated datetime in kdb+?
Thank you for your advice. Best Regards