Getting String Representation of the given Date and Time Object in R Programming - strftime() Function Last Updated : 02 Mar, 2021 Comments Improve Suggest changes Like Article Like Report 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:15:10 EST" # Calling strftime() function strftime(x) Output: [1] "2020-06-01 16:15:10" Example 2: Python3 # R program to illustrate # strftime function # Specifying a date and time using # as.Date( ) function which converts # the character data to dates. x <- as.Date("2020-06-17 12:10:20 EST") # Calling the strftime() function using the % F format # which is equivalent to % Y-% m-% d (the ISO 8601 date format) y <- strftime(x, '% F') # Getting string representation of # the given date and time object y Output: [1] "2020-06-17" Comment More infoAdvertise with us Next Article Getting String Representation of the given Date and Time Object in R Programming - strftime() Function K Kanchan_Ray Follow Improve Article Tags : R Language R String-Functions R Date-Function Similar Reads Display the internal Structure of an Object in R Programming - str() Function str() function in R Language is used for compactly displaying the internal structure of a R object. It can display even the internal structure of large lists which are nested. It provides one liner output for the basic R objects letting the user know about the object and its constituents. It can be 3 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 Determine the Month on a Specific Date in R Programming - months() Function months() function in R Language is used to determine the month on a specific date passed to it as argument. Syntax: months(date, abbreviate) Parameters: date: Date to be checked abbreviate: Boolean value to abbreviate month Example 1: Python3 1== # R program to find the month # on a specific date # 1 min read Determine the Quarter in which the Specific Date lies in R Programming - quarters() Function quarters() function in R Language is used to determine the quarter in which a specific date passed to it as argument lies. Syntax: quarters(date) Parameters: date: Date to be checked Example 1: Python3 1== # R program to find the quarter # of a specific date # Specifying the date date <- as.POSIX 1 min read Get Date and Time in different Formats in R Programming - date(), Sys.Date(), Sys.time() and Sys.timezone() Function 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" Sy 1 min read Like