Courtesy of the ?strptime
help file (with the example changed to your value):
z <- strptime("2010-01-15 13:55:23.975", "%Y-%m-%d %H:%M:%OS")
z # prints without fractional seconds
op <- options(digits.secs=3)
z
options(op) #reset options
More Related Contents:
- strptime, as.POSIXct and as.Date return unexpected NA
- R: merge two irregular time series
- R: convert date from character to datetime [duplicate]
- How to prevent ifelse() from turning Date objects into numeric objects
- Insert rows for missing dates/times
- Changing date format in R
- Basic lag in R vector/dataframe
- Split date-time column into Date and time variables
- How do you convert POSIX date to day of year?
- Date conversion from POSIXct to Date in R
- Forecasting time series data
- How to make gradient color filled timeseries plot in R
- How to Parse Year + Week Number in R?
- How to join two dataframes by nearest time-date?
- How to determine if date is a weekend or not (not using lubridate)
- Return data subset time frames within another timeframes?
- Analyzing Daily/Weekly data using ts in R
- Creating regular 15-minute time-series from irregular time-series
- Subset xts object by time of day
- Change day of the month in a Date to first day (01)
- Filling missing dates in a grouped time series – a tidyverse-way?
- extract hours and seconds from POSIXct for plotting purposes in R
- Convert hours:minutes:seconds to minutes
- Replace -inf, NaN and NA values with zero in a dataset in R
- Calculating Time Difference between two columns
- as.Date(as.POSIXct()) gives the wrong date?
- Milliseconds puzzle when calling strptime in R
- R datetime series missing values
- Using geom_rect for time series shading in R
- How to calculate time difference with previous row of a data.frame by group