time_s <- "2017-05-30T09:20:00-08:00"sub("^(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}).*", "\\1 \\2", time_s)
Standard input is empty
[1] "2017-05-30 09:20:00"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!