
Console.WriteLine(aDate.ToString( "MM/dd/yyyy HH:mm" )). Console.WriteLine(aDate.ToString( "dddd, dd MMMM yyyy HH:mm:ss" )). Console.WriteLine(aDate.ToString( "dddd, dd MMMM yyyy" )). Console.WriteLine(aDate.ToString( "MM/dd/yyyy" )). // Format Datetime in different formats and display them. It can be any DateTime object in your code. fffffff-> Represents the seven most significant digits of the second's fraction that is, it represents the ten-millionths of a second in a date and time value. ffffff-> Represents the six most significant digits of the seconds' fraction that is, it represents the millionths of a second in a date and time value. fffff-> Represents the five most significant digits of the seconds' fraction that is, it represents the hundred-thousandths of a second in a date and time value. While it is possible to display the ten-thousandths of a second component of a time value, that value may not be meaningful.
ffff-> Represents the four most significant digits of the seconds' fraction that is, it represents the ten-thousandths of a second in a date and time value. fff-> Represents the three most significant digits of the seconds' fraction that is, it represents the milliseconds in a date and time value.
ff-> Represents the two most significant digits of the seconds' fraction in date and time. f-> Represents the most significant digit of the seconds' fraction that is, it represents the tenths of a second in a date and time value. zzz-> With DateTime values represents the signed offset of the local operating system's time zone from UTC, measured in hours and minutes. zz-> As z, but with leading zero (e.g. z-> With DateTime values represents the signed offset of the local operating system's time zone fromĬoordinated Universal Time (UTC), measured in hours. K-> Represents the time zone information of a date and time value (e.g. MM-> Month number with leading zero(eg.04). HH-> 24-hour clock hour, with a leading 0 (e.g. hh-> 12-hour clock, with a leading 0 (e.g. dddd-> Represents the full name of the day (Monday, Tuesday, etc).ddd-> Represents the abbreviated name of the day (Mon, Tues, Wed, etc).dd -> Represents the day of the month as a number from 01 through 31.d -> Represents the day of the month as a number from 1 through 31.