Mohamed Abas Tabousha
Mohamed Abas Tabousha

Reputation: 41

Cassandra Timestampe

I want ask about timestampe formate in the insert command in the following sample when i insert any number like "12" or "15" in the "message_sent _at" I found that all the values of the timestamp fields is the same value : 1970-01-01 02:00 EGYPT standard time .

sample:

CREATE TABLE chat (
  id1 int,
  id2 int,
  message_sent_at timestamp,
  message text,
  primary key ((id1, id2), message_sent_at)
 )

Upvotes: 1

Views: 869

Answers (1)

Richard
Richard

Reputation: 11100

The units of timestamp type are milliseconds since the epoch (1/1/1970 00:00:00 UTC). Entering 12 means 12 ms after midnight so will be rounded to the time you print (in your timezone) when displayed in that format.

You can create timestamps from dates here: http://www.epochconverter.com/.

Upvotes: 1

Related Questions