WebODF uses timestamps with milliseconds

pull/1/head
Victor Dubiniuk 9 years ago
parent d93ee482af
commit 3fbf3237e2

@ -90,7 +90,7 @@ class Op extends \OCA\Documents\Db {
$op = array(
'optype' => 'AddMember',
'memberid' => (string) $memberId,
'timestamp' => (string) time(),
'timestamp' => $this->getMillisecondsAsString(),
'setProperties' => array(
'fullName' => $fullName,
'color' => $color,
@ -106,7 +106,7 @@ class Op extends \OCA\Documents\Db {
'optype' => 'RemoveCursor',
'memberid' => (string) $memberId,
'reason' => 'server-idle',
'timestamp' => (string) time()
'timestamp' => $this->getMillisecondsAsString()
);
$this->insertOp($esId, $memberId, $op);
}
@ -115,7 +115,7 @@ class Op extends \OCA\Documents\Db {
$op = array(
'optype' => 'RemoveMember',
'memberid' => (string) $memberId,
'timestamp' => (string) time()
'timestamp' => $this->getMillisecondsAsString()
);
$this->insertOp($esId, $memberId, $op);
}
@ -125,7 +125,7 @@ class Op extends \OCA\Documents\Db {
$op = array(
'optype' => 'UpdateMember',
'memberid' => (string) $memberId,
'timestamp' => (string) time(),
'timestamp' => $this->getMillisecondsAsString(),
'setProperties' => array(
'fullName' => $fullName,
)
@ -184,4 +184,11 @@ class Op extends \OCA\Documents\Db {
}
return $ops;
}
protected function getMillisecondsAsString(){
$microtime = microtime();
list($usec, $sec) = explode(" ", $microtime);
$milliseconds = $sec.substr($usec, 2, 3);
return $milliseconds;
}
}

Loading…
Cancel
Save