Created
May 23, 2024 18:56
-
-
Save helloimalemur/a756749e57c12b3d289c2cde29c09fc3 to your computer and use it in GitHub Desktop.
PHP -> Elasticsearch Index Timestamp Format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PHP -> Elasticsearch Index Timestamp Format | |
$timestamp_pre = date("Y-m-d"); | |
$timestamp_pose = date("H:i:s.u"); | |
$tlen = strlen($timestamp_pose); | |
$tsub = substr($timestamp_pose, 0, $tlen-3); | |
$tsub = $tsub."Z"; | |
$t = $timestamp_pre."T".$tsub; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment