Skip to content

Instantly share code, notes, and snippets.

@jasdev
Created July 31, 2012 06:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jasdev/3214252 to your computer and use it in GitHub Desktop.
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