1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Minutes and seconds to fractions of an hour (or degree)

Discussion in 'T&T - Plugins' started by dcantor, Apr 17, 2017.

  1. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Say you want to express 15 minutes and 30 seconds as a fraction of an hour.

    Charles Dye already has a function @timefmt[hh:mm:ss,15] which will display that time as fractions of a day. So, if you force the hours to zero, and multiply by 24, you can get mm:ss as fractions of an hour. Or fractions of a degree of arc.

    Code:
    echo %@eval[%@timefmt[00:mm:ss,15]*24 =.4]
    
     
  2. JohnQSmith

    Joined:
    Jan 19, 2011
    Messages:
    559
    Likes Received:
    7
    OK, "you want to express 15 minutes and 30 seconds as a fraction of an hour."

    Now what? =D
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,970
    Likes Received:
    30
    v:\> set hh=0

    v:\> set mm=15

    v:\> set ss=30

    v:\> echo %@eval[%@makeage[1601-01-01,%hh:%mm:%ss] / (10000000*3600)]
    0.2583333333
     
  4. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    I guess I should have finished the note.
    Code:
    echo %@eval[%@timefmt[00:15:30,15]*24 =.6]
    0.258333
    
     

Share This Page