-1

I am storing epoch time ( number of millis) in C* db, but when it comes to retrieving the row data back, i am getting data in following format.

starts: {
low: 1753507485
high: 330
unsigned: false
}

My table structure looks like following:

CREATE TABLE ks.cron_tasks(
    type varchar,
    starts bigint,
    chatid varchar,
    status varchar,
    result varchar,
    PRIMARY KEY (type, starts)
);

I verified that data is inputted into db correctly, but when getting data back i am getting low and high parameters.

Note: My tz is IST (GMT+330 minutes).

My input was '1419092715165' value for starts.

Now, how can i get this exact value back.

Gaurav Gupta
  • 4,586
  • 4
  • 39
  • 72
  • As an alternative solution to this problem, i can store starts in form of double and it works pretty well. But still i am curious to know How bigint data is separated in high and low parts. – Gaurav Gupta Dec 20 '14 at 17:07

1 Answers1

2

Based on your tags I'm guessing you are using the node.js driver. That driver uses the long.js class for representing 64 bit integers (bigint is a 64 bit integer).

https://www.npmjs.com/package/long

The low and high represent the first and second 32 bits of the integer. You should be able to get a string representation of the integer by calling toString() on the long object.

//string value of the integer representation
var val = row.starts.toString();

Google Closure Long documentation.

jorgebg
  • 6,560
  • 1
  • 22
  • 31
nickmbailey
  • 3,674
  • 15
  • 14