Closed kevinjoeATdatakaveri closed 3 years ago
thanks for opening the issue @kevinjoeATdatakaveri
We're still working to provide proper support for date/datetime types.
Meanwhile it's possible to deal with timestamp from the sdks by converting values into a date object in the corresponding programming language e.g. in go t := time.Unix(ts, 0)
instantiates t of type time.Time, then you can manipulate it from your application e.g. fmt.Println("MM-DD-YYYY : ", t.Format("01-02-2006"))
invalid timestamp data type value
tl;dr
how do you create values for the SQL timestamp data type?
now()
doesn't work with time stamps outputsint
using epochsWhat happened?
Invalid value while interting a
"yyyy-mm-dd hh:mm:ss.fff"
value for a timestamp data type.how to reproduce
installed immudb and immuclient from here locally on a pop_os 20.04 LTS using
v.1.0.1
running a zsh shellIssue
We need to use the timestamp data type to log time stamps in our data base. I have created a database that needs to use a timestamp using:
create table dummytable (ts timestamp, string1 varchar, string2 varchar, string3 varchar)
We (our team) have tried a few ways to insert into tables but none of them worked. Here's a screenshot of the output. We've tried
insert into dummytable (ts, string1, string2, string3) values ('2021-06-18 21:38:42', 'foo', 'bar', 'baz' );
insert into dummytable (timeStamp, string1, string2, string3) values ('2021-06-18 21:38:42'::timestamp, 'foo', 'bar', 'baz' );
insert into dummytable (timeStamp, string1, string2, string3) values (NOW(), 'foo', 'bar', 'baz' );
We tried the above commands using psql (from the docs here) instead of immuclient as well, but it doesn't take our timestamp input. Here's a screenshot of psql output.