i have a file which states duration for a particular event in format MMMMMMSS.Does any one know what kind of format is this for time duration and how to convert it into seconds.I’m using C# language
i have a file which states duration for a particular event in format MMMMMMSS.Does
Share
If the format is really
M...MSS(supplied as an integervalue), converting it to seconds is quite easy:Why does it work?
value / 100removes the last two digits (integer division), thus returningMMMMMM, andvalue % 100returns the last two digits (modulo), i.e.,SS.MMMMMM * 60 + SS, which should be pretty self-explanatory.