Let’s say we have a Nullable DateTime named StartTime [DisplayFormat(DataFormatString = “{0:dd.MM.yyyy}”)] public Nullable<System.DateTime> StartTime { get; set; }
Let’s say we have a Nullable DateTime named StartTime [DisplayFormat(DataFormatString = “{0:dd.MM.yyyy}”)] public Nullable<System.DateTime> StartTime { get; set; }
SQL Server provides a number of options you can use to format a date/time string. One of the first considerations is the actual date/time needed. The most common is the current date/time usingĀ getdate(). This provides the current date and time according to the server providing the date and time. If a universal date/time is needed, […]
You can use both methods: DateTime.Now.Day.ToString(“00”); DateTime.Now.ToString(“dd”);