Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Comparison of time entries
Replies: 11   Last Post: Apr 25, 2012 1:33 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 6,854
Registered: 6/7/07
Re: Comparison of time entries
Posted: Apr 24, 2012 10:00 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 4/24/2012 8:50 AM, Johannes wrote:
> Hi, I really hope you can help me.
>
> I'm looking for a way to compare two time entries in an Excel-File
> effectively.
> The entries are given in the form 'hh:mm:ss' e.g. '14:28:30'.
>
> I would like to figure out the chronological order of the two entries.
> So, how is it possible to determine, that '17:50:23' is later than
> '17:45:33' for example?
>
> I tried to use the function datenum.
>
> a =datenum('14:52:49') = 7.364215839004630e+005
> b =datenum('15:50:49') = 7.363616255671296e+005
> _____________________________________________
>
> a - b = -59.958333333372138
>
> Why is the result negative?


Well, you subtracted the datenum value for the time of 1500 hrs _from_
that of 1400 hrs; what would you expect?

Obviously 15: comes _after_ 14; b-a>0

--




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.