Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Format number of seconds to days, hours, minutes, seconds


  • Please log in to reply
32 replies to this topic
SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Windows Vista will have this in-built :!: : GetDurationFormat()
kWo4Lk1.png

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
Here's a related function that converts milliseconds to a time stamp:

ts(n, r = 1000) {
	s -= ((m := s := n) //= i := 60 * r) * i
	Return, m . ":" . SubStr(0 . s /= r, 1 + (s > 9), 2 + 4 * (s > s // 1))
}

e.g. ts(128142) = 2:08.142; ts(82000) = 1:22

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Dear PhiLho / Laszlo / Titan :)

I need some related help here: Calculating Age from two DateTime Stamps

Please help. :)