Cicode Programming Reference > Cicode Function Categories > Timestamp Functions > TimeIntToTimestamp

TimeIntToTimestamp

Converts a time INTEGER which is represented as a number of seconds since 01/01/1970 to a TIMESTAMP.

Syntax

TimeIntToTimestamp(INT TimeInt [, INT Millisecond [, INT UTC]])

TimeInt:

The number of seconds since 01/01/1970.

Millesecond:

The number of milliseconds since last second (optional).

UTC:

Coordinated Universal Time (optional):

0 – The given time INTEGER is a local date/time.

1 – The given time INTEGER is a UTC date/time (default).

Return Value

A TIMESTAMP variable or INVALID_TIMESTAMP if invalid.

Related Functions

TimestampCurrent, TimestampDifference, TimestampSub, TimestampToStr, TimestampAdd, TimestampCreate, TimestampFormat, TimestampGetPart, TimestampToTimeInt

Example

	INT TimeInt = TimeCurrent();
	TIMESTAMP t1 = TimeIntToTimestamp(TimeInt);
	STRING sTimestamp = TimestampToStr(t1, 0, 0);
	// sTimestamp equals current time in the short time format
	// i.e. ‘HH:MM AM/PM’

See Also

Timestamp Functions

Published June 2018