Parsing Date and Time in R Programming - strptime() Function Last Updated : 02 Mar, 2021 Comments Improve Suggest changes Like Article Like Report 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 to be used for the conversion Example 1: Python3 # R program to illustrate # strptime function # Specifying a time x <- "13:15:17" # Calling strptime() function # over specified time and template y <- strptime(x, "% H:% M:% S") # Getting the current date and # given time into specified template y Output: [1] "2020-06-17 13:15:17 UTC" Example 2: Python3 # R program to illustrate # strptime function # Specifying a date and time x <- "10-02-2020 05:05:06 AM" # Calling strptime() function # over specified date and time, template # and time zone y <- strptime(x, "% d-% m-% Y % I:% M:% S", "GMT") # Getting parsed date and time y Output: [1] "2020-02-10 05:05:06 GMT" Comment More infoAdvertise with us Next Article Parsing Date and Time in R Programming - strptime() 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 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 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 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 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 Like