date() Function in R (Example)


This post explains how to return the current system date and time using the date() function in the R programming language.

The page consists of the following content:

With that, let’s get started.


Example: Get System Date & Time Using date() Function

The code below illustrates how to print the current system date (i.e. weekday, month, day, and year) and time (i.e. hours, minutes, and seconds) to the RStudio console.

For this, we can apply the date function as shown below:

date()                     # Apply date function
# [1] "Wed Oct 13 13:19:44 2021"

As you can see, this tutorial was created on Wednesday, 13th of October 2021, at 1:19:44 pm.


Video, Further Resources & Summary

If you need more information on the R syntax of this article, I recommend watching the following video on my YouTube channel. I show the R programming syntax of this article in the video tutorial:



Furthermore, you could have a look at the related tutorials on this homepage. I have released several related articles already.


In this R tutorial you have learned how to use the date() function. If you have additional questions or comments, let me know in the comments. Besides that, don’t forget to subscribe to my email newsletter to receive updates on new tutorials.


Subscribe to the Statistics Globe Newsletter

Get regular updates on the latest tutorials, offers & news at Statistics Globe.
I hate spam & you may opt out anytime: Privacy Policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.