Home >Backend Development >Golang >How to Convert a 12-Byte Int96 Timestamp to a GoLang Timestamp?
In this scenario, you have a 12-byte int96 timestamp array and want to convert it to a timestamp in GoLang.
Typically, int96 timestamps consist of an 8-byte nanoseconds part and a 4-byte date part stored as a Julian day number. However, in this case, the first 8 bytes are actually nanoseconds, not milliseconds, and the epoch is midnight, not the Unix epoch.
To illustrate the conversion process, let's consider the following int96 timestamp:
To interpret it correctly:
Therefore, the int96 timestamp [128 76 69 116 64 7 0 0 48 131 37 0] represents the timestamp 2000-01-01 12:34:56 in GoLang.
The above is the detailed content of How to Convert a 12-Byte Int96 Timestamp to a GoLang Timestamp?. For more information, please follow other related articles on the PHP Chinese website!