Format Function Changes in Visual Basic
The following sections detail the changes Visual Basic .NET makes to the date/time, numeric, and string formats.
Date/Time Format
Visual Basic 6.0
In Visual Basic 6.0, to display a short or long date, you use either the "ddddd" or "dddddd" format specifier. The DayOfWeek ("w") and WeekOfYear ("ww") specifiers display the day considered to be the first day of the week, and the week considered to be the first week of the year. The lowercase "m" character displays the month as a number without a leading zero. The Quarter specifier ("q") displays the quarter of the year as a number from 1 – 4.
To display a minute as a number with or without leading zeros, you use either the "Nn" or the "N" format specifier. The characters "Hh" display the hour as a number with leading zeros, and "ttttt" displays the time as a complete time. To display either an uppercase or lowercase "A" or "P" with any hour before or after noon, you use either "AM/PM", "am/pm", "A/P", "a/p", or "AMPM."
Visual Basic .NET
In Visual Basic .NET, "ddddd" and "dddddd" behave the same as "dddd", displaying the full name of the day. They do not display the short date and long date. DayOfWeek ("w") and WeekOfYear ("ww") are not supported; instead, use the DatePart function as follows:
Format(Datepart(DateInterval.WeekOfYear, Now))
"M" and "m" apply to different things, so both are now case sensitive. Use uppercase "M" only for the month in the date portion of a date/time format, and lowercase "m" only for the minutes in the time portion.
The Quarter format specifier is not supported; instead, use the DatePart function as follows:

Join the conversation! Your thoughts help the community grow.