Skip to content
Snippets Groups Projects
Commit 9d7b33bc authored by Sergey Bronnikov's avatar Sergey Bronnikov Committed by Sergey Kaplun
Browse files

datetime: support timestamp field in :totable()

`datetime` module has a function `:totable()` that converts
the information from a datetime object into the table format.
The field `timestamp` can be accessed in a datetime object:

```
tarantool> dt = datetime.new({timestamp=100})
---
...

tarantool> dt.timestamp
---
- 100
...
```

However, the timestamp is missed in a table produced by
`:totable()` method. The patch fixes that.

Fixes #10374

@TarantoolBot document
Title: Support of timestamp field in :totable()

The field `timestamp` is available in a table produced by
`:totable`:

```
tarantool> datetime.new({timestamp=100}):totable()
---
- timestamp: 100
  tz:
  sec: 40
  min: 1
  yday: 1
  day: 1
  nsec: 0
  isdst: false
  wday: 5
  tzoffset: 0
  month: 1
  year: 1970
  hour: 0
...

tarantool>
```

(cherry picked from commit f66020b670296642547cbfe0a34ab6c11d69989d)
parent 6b4a6dd1
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment