VOOZH about

URL: https://www.geeksforgeeks.org/r-language/parsing-date-and-time-in-r-programming-strptime-function/

⇱ Parsing Date and Time in R Programming - strptime() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Parsing Date and Time in R Programming - strptime() Function

Last Updated : 15 Jul, 2025

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: 
 

Output: 
 

[1] "2020-06-17 13:15:17 UTC"


Example 2: 
 

Output: 
 

[1] "2020-02-10 05:05:06 GMT"


 

Comment
Article Tags:

Explore