Get Date and Time in different Formats in R Programming - date(), Sys.Date(), Sys.time() and Sys.timezone() Function Last Updated : 12 Jun, 2020 Comments Improve Suggest changes Like Article Like Report date() function in R Language is used to return the current date and time. Syntax: date() Parameters: Does not accept any parameters Example: Python3 # R program to illustrate # date function # Calling date() function to # return current date and time date() Output: [1] "Thu Jun 11 04:29:39 2020" Sys.Date() Function Sys.Date() function is used to return the system's date. Syntax: Sys.Date() Parameters: Does not accept any parameters Example: Python3 # R program to illustrate # Sys.Date function # Calling Sys.Date() function to # return the system's date Sys.Date() Output: [1] "2020-06-11" Sys.time() Sys.time() function is used to return the system's date and time. Syntax: Sys.time() Parameters: Does not accept any parameters Example: Python3 # R program to illustrate # Sys.time function # Calling Sys.time() function to # return the system's date and time Sys.time() Output: [1] "2020-06-11 05:35:49 UTC" Sys.timezone() Sys.timezone() function is used to return the current time zone. Syntax: Sys.timezone() Parameters: Does not accept any parameters Example: Python3 # R program to illustrate # Sys.timezone function # Calling Sys.timezone() function to # return the current time zone Sys.timezone() Output: [1] "Etc/UTC" Comment More infoAdvertise with us Next Article Get Date and Time in different Formats in R Programming - date(), Sys.Date(), Sys.time() and Sys.timezone() Function K Kanchan_Ray Follow Improve Article Tags : R Language R Date-Function Similar Reads Convert a String into Date Format in R Programming - as.Date() Function as.Date() function in R Language is used to convert a string into date format. Syntax: as.Date(x, format) Parameters: x: string variable format: Format in which string is declared(%m/%d/%y) Example 1: Python3 1== # R program to convert string into date # Creating a string vector dates <- c(" 1 min read Parsing Date and Time in R Programming - strptime() Function strptime() function in R Language is used to parse the given representation of date and time with the given template. Syntax: strptime(x, format, tz = "")Parameters: x: given representation of date and time y: given template in which parsing is done tz: a character string specifying the time zone t 1 min read Calculate Time Difference between Dates in R Programming - difftime() Function difftime() function in R Language is used to calculate time difference between dates in the required units like seconds, minutes, days, weeks, etc. Syntax: difftime(date1, date2, units) Parameters:date1, date2: Dates to calculate difference units: seconds, minutes, days, weeksExample 1:R# R program 1 min read Getting String Representation of the given Date and Time Object in R Programming - strftime() Function strftime() function in R Language is used to convert the given date and time objects to their string representation. Syntax: strftime(time) Parameters: time: specified time object Example 1:  Python3 # R program to illustrate # strftime function # Specifying a date and time x <- "2020-06-01 16 1 min read Determine the Weekday on a Specific Date in R Programming - weekdays() Function weekdays() function in R Language is used to determine the weekday on a specific date passed to it as argument. Syntax: weekdays(date, abbreviate) Parameters: date: Date to be checked abbreviate: Boolean value to abbreviate weekday Example 1: Python3 1== # R program to find the weekday # on a specif 1 min read Like