0

As I see in documentation,

I can add one year to any date using datetime() function:

SELECT datetime('2014-01-23 12:33:34', '1 year')

Result is 2015-01-23 12:33:34.

But I have timestamp in column (int value), for example 1390466014. When I try to add year to this timestamp using datetime() function I obtain null instead of 1422005614 in result:

SELECT datetime(1390466014, '1 year')  -- null

How to add one year to timestamp to obtain new timestamp? Does Tarantool have any functions for working with timestamps?

Nick
  • 9,735
  • 7
  • 59
  • 89

1 Answers1

1

Your problem is that Tarantool 1.8.1 is storing and handling datetime as strings. So, if you want to use Unix time, just say thart explicitly, like that:

tarantool> SELECT datetime(datetime(1390466014, 'unixepoch'), '1 year')
---
- - ['2015-01-23 08:33:34']
...