> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md).

# TimeStamp

[Data Structures](#nested-classes) | [Public Member Functions](#pub-methods) | [Static Public Member Functions](#pub-static-methods) | [Static Public Attributes](#pub-static-attribs)

`#include <`[timestamp.h](/s-adk-5.1-programmers-guide/sdi_2src_2timestamp_8h_source.md)`>`

Inheritance diagram for TimeStamp:

![Inheritance graph](/files/S0L2OuhhaZEB28XbgHfy)

\[[legend](/s-adk-5.1-programmers-guide/graph_legend.md)]

Collaboration diagram for TimeStamp:

![Collaboration graph](/files/QAkOPKguEgw5c3iz2Lp5)

\[[legend](/s-adk-5.1-programmers-guide/graph_legend.md)]

|                 |                                                     |
| --------------- | --------------------------------------------------- |
| Data Structures |                                                     |
| class           | [Unit\_MS](#classsdi_1_1_time_stamp_1_1_unit___m_s) |
| class           | [Unit\_S](#classsdi_1_1_time_stamp_1_1_unit___s)    |

|                                                                                                       |                                                                                                                                                                  |
| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Public Member Functions                                                                               |                                                                                                                                                                  |
|                                                                                                       | [TimeStamp](#a9b9283e7c6c516e9b5af4c4c572272fb) (time\_t sec, long nsec)                                                                                         |
|                                                                                                       | [TimeStamp](#ab2ba7ae29a942d1f8c877bbf7cb52c72) (char sec)                                                                                                       |
|                                                                                                       | [TimeStamp](#a14104c0dc2882a7e92791e4ae5dae397) (unsigned char sec)                                                                                              |
|                                                                                                       | [TimeStamp](#ae3a8cbeed587317ec470d73a917235d0) (short sec)                                                                                                      |
|                                                                                                       | [TimeStamp](#ad142366537fd6c90f004a7e7e5fe76b3) (unsigned short sec)                                                                                             |
|                                                                                                       | [TimeStamp](#a8c53f124e0a56739dddf21f5dbc09a70) (int sec)                                                                                                        |
|                                                                                                       | [TimeStamp](#aa765877a40bab49a4ac7edae54037ace) (unsigned sec)                                                                                                   |
|                                                                                                       | [TimeStamp](#a1e6ced60d3f8ed8145b1174670041b91) (long sec=0)                                                                                                     |
|                                                                                                       | [TimeStamp](#a4bdcc7c53fd88e093a7704f97e33f1a6) (unsigned long sec)                                                                                              |
|                                                                                                       | [TimeStamp](#a09ee54474a3cf2a0dcb44c3bba1d93f0) (float t)                                                                                                        |
|                                                                                                       | [TimeStamp](#a0562a683beb2e90aad6d80115ff34922) (double t)                                                                                                       |
| [TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) & | [operator=](#a6b8cf0214a5543eef3359c68908c8cb1) (time\_t sec)                                                                                                    |
| [TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) & | [operator=](#a220b30dc8ef7ce4318d91a730018108a) (double t)                                                                                                       |
| [TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) & | [operator+=](#a0f92836fe65f6dff8f6dd9a57263efef) (const [TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&o) |
| [TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) & | [operator-=](#a6a8198da471ba013e2782a227b9827e1) (const [TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) \&o) |
| double                                                                                                | [get](#af53ec2e557ea14cce1373e0f77954c82) () const                                                                                                               |
| void                                                                                                  | [set](#a2e41358ea1b66ce29560cff3e3f8107f) (double t)                                                                                                             |
| time\_t                                                                                               | [s](#a1531798c1dbb04cecaa02940a60db134) () const                                                                                                                 |
| long                                                                                                  | [ms](#a08c27c4fe2b5cab5ef3744e02994c70f) () const                                                                                                                |
| void                                                                                                  | [normalize](#acd0de676568888d848beb97dcc53ae47) ()                                                                                                               |
| void                                                                                                  | [clear](#ac8bb3912a3ce86b15842e79d0b421204) ()                                                                                                                   |

|                                                                                                            |                                                    |
| ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| Static Public Member Functions                                                                             |                                                    |
| static [TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) | [Clock](#af6793cbedf60ccb7568f45922dcc37df) ()     |
| static [TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) | [Monotonic](#aaf8485a75440007e7a7a67303cb050f8) () |

|                                                            |                                          |
| ---------------------------------------------------------- | ---------------------------------------- |
| Static Public Attributes                                   |                                          |
| static [Unit\_MS](#classsdi_1_1_time_stamp_1_1_unit___m_s) | [MS](#af8efbdf5651c7a9db8f251bbae6a395a) |
| static [Unit\_S](#classsdi_1_1_time_stamp_1_1_unit___s)    | [S](#afbc12be2aec255bec764c345ba4154bc)  |

### DetailedDescription <a href="#detailed-description" id="detailed-description"></a>

time utility class

***

### DataStructure Documentation <a href="#data-structure-documentation" id="data-structure-documentation"></a>

### sdi::TimeStamp::Unit\_MS <a href="#classsdi_1_1_time_stamp_1_1_unit___m_s" id="classsdi_1_1_time_stamp_1_1_unit___m_s"></a>

class sdi::TimeStamp::Unit\_MS

helper class for unit conversion

### sdi::TimeStamp::Unit\_S <a href="#classsdi_1_1_time_stamp_1_1_unit___s" id="classsdi_1_1_time_stamp_1_1_unit___s"></a>

class sdi::TimeStamp::Unit\_S

helper class for unit conversion

### Constructor& Destructor Documentation

### TimeStamp()\[1/11] <a href="#a9b9283e7c6c516e9b5af4c4c572272fb" id="a9b9283e7c6c516e9b5af4c4c572272fb"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

constuctor

**Parameters**

\[in] **sec** seconds \[in] **nsec** nanoseconds

### TimeStamp()\[2/11] <a href="#ab2ba7ae29a942d1f8c877bbf7cb52c72" id="ab2ba7ae29a942d1f8c877bbf7cb52c72"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

inline

constuctor

**Parameters**

\[in] **sec** seconds

### TimeStamp()\[3/11] <a href="#a14104c0dc2882a7e92791e4ae5dae397" id="a14104c0dc2882a7e92791e4ae5dae397"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

inline

constuctor

**Parameters**

\[in] **sec** seconds

### TimeStamp()\[4/11] <a href="#ae3a8cbeed587317ec470d73a917235d0" id="ae3a8cbeed587317ec470d73a917235d0"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

inline

constuctor

**Parameters**

\[in] **sec** seconds

### TimeStamp()\[5/11] <a href="#ad142366537fd6c90f004a7e7e5fe76b3" id="ad142366537fd6c90f004a7e7e5fe76b3"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

inline

constuctor

**Parameters**

\[in] **sec** seconds

### TimeStamp()\[6/11] <a href="#a8c53f124e0a56739dddf21f5dbc09a70" id="a8c53f124e0a56739dddf21f5dbc09a70"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

inline

constuctor

**Parameters**

\[in] **sec** seconds

### TimeStamp()\[7/11] <a href="#aa765877a40bab49a4ac7edae54037ace" id="aa765877a40bab49a4ac7edae54037ace"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

inline

constuctor

**Parameters**

\[in] **sec** seconds

### TimeStamp()\[8/11] <a href="#a1e6ced60d3f8ed8145b1174670041b91" id="a1e6ced60d3f8ed8145b1174670041b91"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

inline

constuctor

**Parameters**

\[in] **sec** seconds

### TimeStamp()\[9/11] <a href="#a4bdcc7c53fd88e093a7704f97e33f1a6" id="a4bdcc7c53fd88e093a7704f97e33f1a6"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

inline

constuctor

**Parameters**

\[in] **sec** seconds

### TimeStamp()\[10/11] <a href="#a09ee54474a3cf2a0dcb44c3bba1d93f0" id="a09ee54474a3cf2a0dcb44c3bba1d93f0"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

constuctor

**Parameters**

\[in] **t** seconds

### TimeStamp()\[11/11] <a href="#a0562a683beb2e90aad6d80115ff34922" id="a0562a683beb2e90aad6d80115ff34922"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)

constuctor

**Parameters**

\[in] **t** seconds

### MemberFunction Documentation <a href="#member-function-documentation" id="member-function-documentation"></a>

### clear() <a href="#ac8bb3912a3ce86b15842e79d0b421204" id="ac8bb3912a3ce86b15842e79d0b421204"></a>

void clear

inline

reset to 0

### Clock() <a href="#af6793cbedf60ccb7568f45922dcc37df" id="af6793cbedf60ccb7568f45922dcc37df"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) Clock

static

read realtime clock

#### Returns

unix time

### get() <a href="#af53ec2e557ea14cce1373e0f77954c82" id="af53ec2e557ea14cce1373e0f77954c82"></a>

double get

inline

get time

### Monotonic() <a href="#aaf8485a75440007e7a7a67303cb050f8" id="aaf8485a75440007e7a7a67303cb050f8"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) Monotonic

static

read monotonic clock

#### Returns

monitonic time

### ms() <a href="#a08c27c4fe2b5cab5ef3744e02994c70f" id="a08c27c4fe2b5cab5ef3744e02994c70f"></a>

long ms

inline

create millisecond based time stamp

#### Returns

time stamp

### normalize() <a href="#acd0de676568888d848beb97dcc53ae47" id="acd0de676568888d848beb97dcc53ae47"></a>

void normalize

normalize time representation

### operator+=() <a href="#a0f92836fe65f6dff8f6dd9a57263efef" id="a0f92836fe65f6dff8f6dd9a57263efef"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) & operator+=

### operator-=() <a href="#a6a8198da471ba013e2782a227b9827e1" id="a6a8198da471ba013e2782a227b9827e1"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) & operator-=

### operator=()\[1/2] <a href="#a220b30dc8ef7ce4318d91a730018108a" id="a220b30dc8ef7ce4318d91a730018108a"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md) & operator=

assignment operator

**Parameters**

\[in] **t** seconds

### operator=()\[2/2] <a href="#a6b8cf0214a5543eef3359c68908c8cb1" id="a6b8cf0214a5543eef3359c68908c8cb1"></a>

[TimeStamp](/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md)& operator=

inline

assignment operator

**Parameters**

\[in] **sec** seconds

### s() <a href="#a1531798c1dbb04cecaa02940a60db134" id="a1531798c1dbb04cecaa02940a60db134"></a>

time\_t s

inline

create second based time stamp

#### Returns

time stamp

### set() <a href="#a2e41358ea1b66ce29560cff3e3f8107f" id="a2e41358ea1b66ce29560cff3e3f8107f"></a>

void set

inline

set time

### FieldDocumentation <a href="#field-documentation" id="field-documentation"></a>

### MS <a href="#af8efbdf5651c7a9db8f251bbae6a395a" id="af8efbdf5651c7a9db8f251bbae6a395a"></a>

\[TimeStamp::Unit\_MS]\(#classsdi\_1\_1\_time\_stamp\_1\_1\_unit\_\_\_m\_s) MS

static

Millisecond unit

### S <a href="#afbc12be2aec255bec764c345ba4154bc" id="afbc12be2aec255bec764c345ba4154bc"></a>

\[TimeStamp::Unit\_S]\(#classsdi\_1\_1\_time\_stamp\_1\_1\_unit\_\_\_s) S

static

Second unit

***

The documentation for this class was generated from the following files:

* sdi/src/[timestamp.h](/s-adk-5.1-programmers-guide/sdi_2src_2timestamp_8h_source.md)
* sdi/src/[timestamp.cpp](/s-adk-5.1-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/timestamp_8cpp.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/namespaces/namespacesdi/classsdi_1_1_time_stamp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
