![]() |
VOOZH | about |
In this article, we will convert character to timestamp in R Programming Language.
We can convert the character to timestamp by using strptime() method. strptime() function in R Language is used to parse the given representation of date and time with the given template.
Syntax:
strptime(character, format, tz = “”)
Where,
Example 1: Convert character to year , month and date format timestamp
Output:
[1] "2021-04-04 UTC"
Example 2: R program to convert character into timestamp
Output:
[1] "2021-04-04 02:23:34 UTC"
Example 3: In this example, we are going to specify the timezone
Output:
[1] "2021-04-04 02:23:34 UTC"