CSharp examples for System:DateTime Second
Seconds To String
using System.Globalization; using System;/*from ww w. ja va 2s .c o m*/ public class Main{ public static string SecondsToStr(this int seconds) { var mod = seconds % 10; if (mod == 0 || seconds > 10 && seconds < 20) return seconds + " seconds "; if (mod == 1) return seconds + " second "; if (mod < 5) return seconds + " seconds "; return seconds + " seconds "; } }