# ri > MessagePack::Timestamp

---
type: CommandReference
command: MessagePack::Timestamp
mode: ri
section: 
source: ri
---

## Quick Reference

- `MessagePack::Timestamp.new(sec, nsec)` — create a new timestamp
- `timestamp.to_msgpack_ext` — serialize to MessagePack extension
- `MessagePack::Timestamp.from_msgpack_ext(data)` — deserialize from extension
- `timestamp.sec` — get seconds part
- `timestamp.nsec` — get nanoseconds part

## Name

MessagePack::Timestamp < Object — a class representing a timestamp as defined in the MessagePack specification.

## Synopsis

Not applicable (class reference).

## Constants

- `TIMESTAMP32_MAX_SEC` — not documented
- `TIMESTAMP64_MAX_SEC` — not documented
- `TYPE` — the timestamp extension type defined in the MessagePack spec. See [specification](https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type) for details.

## Class Methods

- `from_msgpack_ext` — deserialize from MessagePack extension data
- `new` — create a new timestamp (see attributes)
- `to_msgpack_ext` — serialize to MessagePack extension data

## Instance Methods

- `==` — equality comparison
- `nsec` — nanoseconds part (also attribute reader)
- `sec` — seconds part (also attribute reader)
- `to_msgpack_ext` — serialize to MessagePack extension data

## Attributes

- `nsec` — attr_reader: nanoseconds part
- `sec` — attr_reader: seconds part

## Examples

No examples provided in the original documentation.

## See Also

- [MessagePack specification – timestamp extension type](https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type)