[R] Extract Time in POSIXct

jim holtman jholtman at gmail.com
Fri Mar 20 19:51:16 CET 2009

Do you only want the HH:MM:SS of the data?  What are you going to do
with it?  You can 'extract' it with

format(hora, "%H%:%M:%S")

If you don't want the date and are only working with the hours in a
single day, then convert the time to a numeric value of hours (or
minutes), whichever is appropriate.  So an idea of what you are
actually after and how you plan to use it will help guide some advice.

On Fri, Mar 20, 2009 at 12:59 PM, Paulo E. Cardoso <pecardoso at netcabo.pt> wrote:
> Assunto: Extract Time in POSIXct
> I have a dataframe with a column [hora] with this format:
> hora        : POSIXct, format: "1899-12-30 14:30:00"
> It was obtained reading a access2007 database table.
> Can I extract the time from each entry, keeping the POSIXct format?
> ____________
> Paulo E. Cardoso
> ______________________________________________
> R-help at 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.

Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

More information about the R-help mailing list