Thread: time to decimal

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Posts
    21
    Rep Power
    0

    time to decimal


    I need a formula that will change 5:27 5 hours and 27 minutes into 5.45 hours.,..?

    any suggestions
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    extract minutes from timestamp as an integer value
    percentage = minutes / 60
    round percentage to 2 digits
    place hour and rounded percentage into proper format for final result

IMN logo majestic logo threadwatch logo seochat tools logo