Here we are explaining how to write an R program to find the system’s current date with and without time. For this, we are using the build-in functions Sys.Date() and Sys.time().
One more function is there as
In this R program, this built-in function does not require any arguments. The Sys.time() function will return the current date with the time of the system and the Sys.Date() function, will give the system date only.
STEP 1: call Sys.Date() to print the current system date only
STEP 2: print the function result
STEP 3: call Sys.time() to print the current system date with the timezone
STEP 4: print the function result with time
print("System's idea of the current date without time:")
print(Sys.Date())
print("System's idea of the current date with time:")
print(Sys.time())
[1] "System's idea of the current date without time:" [1] "2021-08-05" [1] "System's idea of the current date with time:" [1] "2021-08-05 17:06:00 UTC"