skip to main | skip to sidebar
Cloud Nebula

Wednesday, October 27, 2010

Round time to nearest 30 seconds

I had a requirement to round the time for a video (in seconds) to the nearest 30 seconds. Not being so strong in math, I am grateful to be better at Googling. So here it is for anyone else in a similar situation:

Math.round(myTime/30)*30

Awesome and simple!
Posted by Brian at 2:50 PM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2011 (9)
    • ►  November (1)
    • ►  July (1)
    • ►  April (2)
    • ►  February (2)
    • ►  January (3)
  • ▼  2010 (33)
    • ►  November (3)
    • ▼  October (7)
      • Communicating between Javascript and Actionscript ...
      • Round time to nearest 30 seconds
      • Titanium gradient for buttonbar
      • Show and hide hidden files on a Mac
      • Titanium does not currently support the clipboard
      • Time Machine issues when hard drive is partitioned
      • Creating a Titanium gradient button for iPhone
    • ►  September (10)
    • ►  June (2)
    • ►  May (4)
    • ►  March (1)
    • ►  February (3)
    • ►  January (3)
  • ►  2009 (26)
    • ►  December (1)
    • ►  November (1)
    • ►  October (3)
    • ►  September (6)
    • ►  August (2)
    • ►  June (1)
    • ►  March (1)
    • ►  February (5)
    • ►  January (6)
  • ►  2008 (70)
    • ►  December (4)
    • ►  November (10)
    • ►  October (6)
    • ►  September (1)
    • ►  August (4)
    • ►  July (2)
    • ►  May (6)
    • ►  April (13)
    • ►  March (7)
    • ►  February (9)
    • ►  January (8)
  • ►  2007 (7)
    • ►  December (7)

About Me

My photo
Brian
View my complete profile