R Programming/Times and Dates

R contains a set of object types for holding date and time information. The system time and date can also be requested.

Format
Many time and date units are recognised. These include:

The default format is yyyy-mm-dd hh:mm:ss or %Y-%m-%d %H:%M:%S

For example 2010-02-13 23:12:24

System Date and Time
To get the system date and time:

Convert strings to date/time objects
Convert a string representing the date or time into a Date/Time object:

Extracting information from dates
Get weekday, month and an integer representing the number of days since the beginning of epoch:

Note that  and   returns results in the local language. For instance, if you turn R into French, you can get weekdays and months in French :