[R] R timeDate does not allow seconds?

jim holtman jholtman at gmail.com
Fri Nov 2 22:58:25 CET 2007


This is what your example had in it.  You can format the data in any
format that you want.  This is nothing special about ':'.

On 11/2/07, B. Bogart <bbogart at sfu.ca> wrote:
> 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]
> >
> >
> >
>
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?



More information about the R-help mailing list