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

Asked

Viewed 2,373 times

5

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

What function results in the date and time of the moment in #R?

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 only want the date can use the function Sys.Date().

> Sys.Date()
[1] "2016-03-08"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.