Skip to content
Prev 336346 / 398503 Next

why is as.date function not working for me? (dd/mm/yyyy h:mm)

as.Date produces Dates only, with no time information, even if you try
to supply it with hours + minutes.

For dates+times, use as.POSIXct() or as.POSIXlt() in place of
as.Date(). POSIXct produces a numeric value for the number of seconds
since your specified origin time (usually 1970-01-01 00:00), and
POSIXlt produces a list object with individual entries for year,
month, day, hour, minute etc. Be aware that time zones and daylight
savings transitions may suddenly come into play. See ?DateTimeClasses
for the gory details.

as.POSIXct(dates, format = "%d/%m/%Y %H:%M")
On Thu, Feb 6, 2014 at 10:24 AM, jcrosbie <james at crosb.ie> wrote: