How to Return a Time Object with Milliseconds in R Programming (Example Code)
In this article, I’ll illustrate how to parse milliseconds in the R programming language.
Example Data
time_data <- "2025-01-01 11:20:20.999" # Create time character |
time_data <- "2025-01-01 11:20:20.999" # Create time character
Example: Printing Time with Milliseconds
options(digits.secs = 3) # Change global options |
options(digits.secs = 3) # Change global options
strptime(time_data, "%Y-%m-%d %H:%M:%OS") # Print time with milliseconds # "2025-01-01 11:20:20.999 CET" |
strptime(time_data, "%Y-%m-%d %H:%M:%OS") # Print time with milliseconds # "2025-01-01 11:20:20.999 CET"