CSharp examples for System:Math Number
Get Formatted Day
using System;//from www . java 2s. c o m public class Main{ public static string GetFormattedDay(DateTimeOffset date) { string toReturn = null; var days = (date.Day - DateTimeOffset.Now.Day); if (days == 0) { toReturn = "today"; } else if (days == 1) { toReturn = "tomorrow"; } else { toReturn = string.Format ("{0:MM/dd}", date); } return toReturn; } }