To get the current date in R, you can use the “Sys.Date()” function.
Sys.Date()
Output
[1] "2023-05-23"
To get the absolute date-time value in R, you can use the “Sys.time()” function.
Sys.time()
Output
[1] "2023-05-23 22:13:24 IST"
To get the system time in a fixed-format character string, you can use the “date()” function.
date()
Output
[1] "Thu Mar 11 16:59:16 2021"
Dates can be imported from character, numeric, POSIXlt, and POSIXct formats in R using as.Date() method.
That’s it.

Krunal Lathiya is a seasoned Computer Science expert with over eight years in the tech industry. He boasts deep knowledge in Data Science and Machine Learning. Versed in Python, JavaScript, PHP, R, and Golang. Skilled in frameworks like Angular and React and platforms such as Node.js. His expertise spans both front-end and back-end development. His proficiency in the Python language stands as a testament to his versatility and commitment to the craft.