How can I get the current date and time in #R?

5

I am creating a process report from a routine, a simplified "logfile", and would like to store the date at the time of the error in a variable.

What function does the current date and time result in #R?

    
asked by anonymous 08.03.2016 / 09:55

1 answer

4

The function that does this is Sys.time() . It returns the date and time, along with timezone.

> Sys.time()
[1] "2016-03-08 07:11:57 BRT"

If you just want the date, you can use the Sys.Date() function.

> Sys.Date()
[1] "2016-03-08"
    
08.03.2016 / 11:13