Hi Jim, Yes that works!!!
Why the heck do I need to put "%H.%M.%S" when the input format is "%H:%M:%S" ? ("." in place of ":". I see in the help(timeDate) examples where the format is properly written as "%Y-%m-%d %H:%M:%S" So why does this not work: > date = timeDate(as.character(inputdate),format="%Y-%m-%d_%H:%M:%S") Error in if (regexpr("/....", charvec[1])[[1]] > 0) return("%m/%d/%Y") : missing value where TRUE/FALSE needed Thanks so much, I don't see how I could have known I would have to put "." in place of ":" in the format string. B. Bogart Simon Fraser University jim holtman wrote: > Seems to work fine with this call: > > >> inputdate = "2007-10-31_16.20.22" >> timeDate(as.character(inputdate),format="%Y-%m-%d_%H.%M.%S") >> > GMT > [1] [2007-10-31 16:20:22] > > > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.