Timeuuid - time() also return milliseconds or microseconds?

172 views
Skip to first unread message

Eric

unread,
Oct 22, 2015, 4:19:27 PM10/22/15
to DataStax PHP Driver for Apache Cassandra User Mailing List
Hi,

can we retrieve the time in milliseconds or microseconds as well, if not can this be added?

DataStax

unread,
Oct 22, 2015, 4:25:05 PM10/22/15
to php-dri...@lists.datastax.com
Indeed, there is no way to extract milliseconds, but I’ve created https://datastax-oss.atlassian.net/browse/PHP-52 to track it.
On Oct 22, 2015, at 1:19 PM, Eric <et...@keek.com> wrote:

Hi,

can we retrieve the time in milliseconds or microseconds as well, if not can this be added?

To unsubscribe from this group and stop receiving emails from it, send an email to php-driver-us...@lists.datastax.com.

Eric

unread,
Feb 3, 2016, 3:26:37 PM2/3/16
to DataStax PHP Driver for Apache Cassandra User Mailing List
Hi Bulat,

this maybe related as well
https://datastax.github.io/php-driver/api/Cassandra/class.Timestamp/
The constructor for time is the unix timestamp in seconds?

I'm trying to do a query matching by a field that is type "timestamp". If I pass in the milliseconds into the Timestamp object constructor, it doesn't return any results. However when I do the query in cqlsh using the same time in milliseconds, it returns a result.

Bulat Shakirzyanov

unread,
Feb 3, 2016, 5:09:04 PM2/3/16
to php-dri...@lists.datastax.com
Hi Eric,

Indeed, the first argument to the Timestamp’s constructor is the unix timestamp value in seconds.
The second argument specifies the number of microseconds (10 ^ -6, not milliseconds, which is 10 ^ -3). E.g. new Timestamp(0, 500000) would be equivalent to a half of a second after the beginning of the Unix epoch.
> --
> You received this message because you are subscribed to the Google Groups "DataStax PHP Driver for Apache Cassandra User Mailing List" group.

Eric

unread,
Feb 4, 2016, 10:44:38 AM2/4/16
to DataStax PHP Driver for Apache Cassandra User Mailing List
Great, I didn't realize you can use the parameters this way. I converted it and it works.

thanks!
Reply all
Reply to author
Forward
0 new messages