---
name: "njb_timeapi"
section: "3"
platform: "linux"
package: "libnjb-doc"
version: "2.2.5-4.3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/njb_timeapi"
---

# njb\_timeapi(3)

## NAME

The time manipulation API -

### Functions

**njb\_time\_t** \* **NJB\_Get\_Time** (**njb\_t** \*njb)\
 int **NJB\_Set\_Time** (**njb\_t** \*njb, **njb\_time\_t** \*time)\
 void **NJB\_Destroy\_Time** (**njb\_time\_t** \*time)\

## Function Documentation

### void NJB\_Destroy\_Time (njb\_time\_t \* time) This destroys a time stamp and frees up any memory used by it.

**Parameters:**

*time* the time stamp to destroy.

**Examples:**  **dumptime.c**, and **settime.c**.

### njb\_time\_t\* NJB\_Get\_Time (njb\_t \* njb) This returns the current time stamp for the device.

**Parameters:**

*njb* a pointer to the `njb_t` object to get the time from.

**Returns:**

a valid time stamp or NULL on failure.

**Examples:**  **dumptime.c**, and **settime.c**.

References njb\_struct::device\_type, and NJB\_DEVICE\_NJB1.

### int NJB\_Set\_Time (njb\_t \* njb, njb\_time\_t \* time) This sets the current time stamp for the device. (Sets the on-board clock.)

**Parameters:**

*njb* a pointer to the `njb_t` object to set the timestamp on. \
 *time* the new timestamp to use (time to set).

**Returns:**

0 on success, -1 on failure.

**Examples:**  **settime.c**.

References njb\_struct::device\_type, NJB\_DEVICE\_NJB1, and njb\_verify\_last\_command().

## Author

Generated automatically by Doxygen for libnjb from the source code.
