Skip to content

Instantly share code, notes, and snippets.

@jasdev
Created Jul 31, 2012
Embed
What would you like to do?
Time representation fun
TimeSpan t = TimeSpan.FromSeconds(time);
f.dataString = distance + " mi" + "\n" + string.Format((t.Hours == 0 ? "" : "{0:D1}h:") + (t.Minutes > 9 ? "{1:D2}m" : "{1:D1}m"), t.Hours, t.Minutes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment