---
name: "time_dlp2palmtime"
section: "3"
platform: "linux"
package: "coldsync"
version: "3.0+pre3-3"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/time_dlp2palmtime"
---

# time\_dlp2palmtime(3)

PalmOS time-conversion functions

## NAME

**time\_dlp2palmtime**, **time\_dlp2time\_t**, **time\_palmtime2dlp**, **time\_time\_t2dlp** – PalmOS time-conversion functions

## LIBRARY

*libpconn*

## SYNOPSIS

**#include \<time.h\>**

**#include \<palm.h\>**

**#include \<pconn/pconn.h\>**

*udword*\

**time\_dlp2palmtime**(*const struct dlp\_time \*dlpt*);

*time\_t*\

**time\_dlp2time\_t**(*const struct dlp\_time \*dlpt*);

*void*\

**time\_palmtime2dlp**(*const udword palmt*, *struct dlp\_time \*dlpt*);

*void*\

**time\_time\_t2dlp**(*const time\_t t*, *struct dlp\_time \*dlpt*);

## DESCRIPTION

Palms use two different representations of time in different contexts. The first, Palm-style *time\_t*, is an integer indicating the number of seconds elapsed since Jan. 1, 1904 (the Palm epoch).

The second representation is a structure listing the individual time fields, similar to a *struct* *tm* :

```
struct dlp_time
{
	uword year;
	ubyte month;
	ubyte day;
	ubyte hour;
	ubyte minute;
	ubyte second;
};
```

(Note that *year* is the four-digit year number, *e.g.*, 2001.)

**time\_dlp2palmtime** takes a *dlp\_time* and converts it to a Palm-style *time\_t*.

**time\_dlp2time\_t** takes a *dlp\_time* and converts it to a Unix-style *time\_t*.

**time\_palmtime2dlp** takes a Palm-style *time\_t* and converts it to a *dlp\_time* structure, writing the results to *dlpt*.

**time\_time\_t2dlp** takes a Unix-style *time\_t* and converts it to a *dlp\_time* structure, writing the results to *dlpt*.

## RETURN VALUE

**time\_dlp2palmtime** returns a Palm-style *time\_t*.

**time\_dlp2time\_t** returns a Unix-style *time\_t*.

## SEE ALSO

[libpconn(3)](/libpconn/3.md), [new\_PConnection(3)](/new_PConnection/3.md).

## BUGS

Palm-style *time\_ts* appear to count the number of seconds since the Palm epoch in the Palm's local time zone. However, it is not obvious how to find out which time zone the Palm thinks it is in, nor whether this is even possible.

Hence, these functions largely ignore the time zone, and hope for the best.
