s-news
[Top] [All Lists]

Re: time format

To: Dr K M MA <kmma@ha.org.hk>
Subject: Re: time format
From: "Henrik Aalborg Nielsen" <immhan@student.dtu.dk>
Date: Fri, 8 Aug 2003 08:26:58 +0200 (METDST)
Cc: s-news-list <s-news@lists.biostat.wustl.edu>
In-reply-to: <3F320946.EE721DA8@ha.org.hk>
One posibility is to transform the columns into time spans, e.g.:

        timeSpan(c("10:30", "09:01"), in.format="%H:%M")

and then just subtract the one from the other.  The output is still a time
span; using 'hms' on this gives you the hours, minutes and so on.

Regards,
Henrik

--------------------------------------------------------------------------
   Henrik Aalborg Nielsen                  
   Informatics and Mathematical Modelling
   Section for Statistics, Time Series Group
   Technical University of Denmark
   Richard Petersens Plads, Build.321,
   DK-2800 Kgs. Lyngby, Denmark.
   Phone:  +45 4525 3418
   Fax.:   +45 4588 2673
   E-mail: han@imm.dtu.dk
   URL:    http://www.imm.dtu.dk/~han
--------------------------------------------------------------------------

On Thu, 7 Aug 2003, Dr K M MA wrote:

> Dear sir,
> 
> Want to calculate the time difference in minutes of two columns; these
> two columns are input as a dataframe.  The format is XX:YY (where XX are
> hours (24 hours) and YY are minutes).  How should one do this?
> 
> Thanks in advance.
> 
> kmma
> Hong Kong
> 
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news
> 


<Prev in Thread] Current Thread [Next in Thread>