diff --git a/lib/Segment/Client.php b/lib/Segment/Client.php index 6b3e931..78e9dff 100644 --- a/lib/Segment/Client.php +++ b/lib/Segment/Client.php @@ -152,7 +152,7 @@ public function getConsumer() { * Formats a timestamp by making sure it is set * and converting it to iso8601. * - * The timestamp can be time in seconds `time()` or `microseconds(true)`. + * The timestamp can be time in seconds `time()` or `microtime(true)`. * any other input is considered an error and the method will return a new date. * * Note: php's date() "u" format (for microseconds) has a bug in it @@ -186,9 +186,9 @@ private function formatTime($ts) { } // microtime(true) - $sec = (int)$parts[0]; - $usec = (int)$parts[1]; - $fmt = sprintf("Y-m-d\\TH:i:s%sP", $usec); + $sec = $parts[0]; + $usec = $parts[1]; + $fmt = sprintf("Y-m-d\TH:i:s.%sP", $usec); return date($fmt, (int)$sec); }