Skip to content
Prev 248817 / 398503 Next

Extract time only from POSIXlt object

Try

tt <- as.POSIXct("2011-01-29 15:00")
tt-trunc(tt,"days")

Note that this result can be used to add or subtract from datetime values, but I don't know of a convenient way to represent it as HH:MM:SS format.
"Simon Goodman" <s.j.goodman at leeds.ac.uk> wrote:

            
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.