Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do "ct" and "lt" (in POSIXct and POSIXlt) mean?

I am interested, what "ct" and "lt" (in POSIXct and POSIXlt) mean. Are they some kind of abbreviations? E.g., does "ct" mean "calendar time" and "lt" something else?

like image 620
GegznaV Avatar asked Jun 27 '17 11:06

GegznaV


2 Answers

I was just looking into this myself and this question came up in my search results.

I've seen several answers to this very question...but they were apparently all wrong! Here is the definitive answer:

POSIXct

The basic POSIX measure of time, calendar time, is the number of seconds since the beginning of 1970, in the UTC timezone (GMT as described by the French).

POSIXlt

The corresponding R class we called POSIXlt (where the ‘lt’ stands for “local time”), which is a list with components as integer vectors, and so can represent a vector of broken-down times. We wanted to keep track of timezones, so where known the timezone is given by an attribute "tzone", the name of the timezone.

Source: R News

I am finally at peace.

like image 99
eustin Avatar answered Oct 10 '22 05:10

eustin


ct = Continuous Time, lt = List Time

Like the questioner (I suspect), I find that understanding acronyms helps me to remember when/how to use them.

I couldn't find any authoritative POSIX references.

From: Statistics: An Introduction Using R, page 316

like image 30
Rod D Avatar answered Oct 10 '22 06:10

Rod D