Cicode Programming Reference > Cicode Function Categories > Timestamp Functions Introduction > TimestampToTimeInt


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


TimestampToTimeInt(TIMESTAMP Timestamp [, INT UTC])


The timestamp variable.


Universal Time Co-ordinate (optional):

0 – Returns the time as a local date/time.

1 – Returns the time as a UTC date/time (default)

Return Value

Time as a number of seconds since 01/01/1970 in UTC or local time depending on the last input parameter,-1 if invalid.

Related Functions

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


TIMESTAMP t1 = TimestampCreate(2009,07,11,09,27,34,123);
INT TimeInt = TimestampToTimeInt(t1);
STRING sTimestamp = TimeToStr(t1, 0, 0);
// sTimestamp equals ‘9:27 AM’

See Also

Timestamp Functions