Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/Segment/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down