Date and time formats are used in combination with BCP 47 language tags to determine how dates and times are outputted from the date and time function. The supported formats are Microsoft's standards for .NET and can be seen on their support site here.
Below is a table of commonly used date formats with 3 different language tags and the date 20 January 2021 which is a Wednesday:
Language | Format | Output |
---|---|---|
en-US | dddd d/M | Wednesday 20/1 |
en-US | d | 1/20/2021 |
en-US | D | Wednesday, January 20, 2021 |
en-US | d. MMMM yyyy | 20. January 2021 |
en-US | MMMM d, yyyy | January 20, 2021 |
en-US | d MMMM yyyy | 20 January 2021 |
en-US | dddd d/M | Wednesday 20/1 |
en-US | MMMM-yyyy | January-2021 |
en-US | yyyy | 2021 |
fr-FR | dddd d/M | mercredi 20/1 |
fr-FR | d | 20/01/2021 |
fr-FR | D | mercredi 20 janvier 2021 |
fr-FR | d. MMMM yyyy | 20. janvier 2021 |
fr-FR | MMMM d, yyyy | janvier 20, 2021 |
fr-FR | d MMMM yyyy | 20 janvier 2021 |
fr-FR | dddd d/M | mercredi 20/1 |
fr-FR | MMMM-yyyy | janvier-2021 |
fr-FR | yyyy | 2021 |
de-DE | dddd d/M | Mittwoch 20.1 |
de-DE | d | 20.01.2021 |
de-DE | D | Mittwoch, 20. Januar 2021 |
de-DE | d. MMMM yyyy | 20. Januar 2021 |
de-DE | MMMM d, yyyy | Januar 20, 2021 |
de-DE | d MMMM yyyy | 20 Januar 2021 |
de-DE | dddd d/M | Mittwoch 20.1 |
de-DE | MMMM-yyyy | Januar-2021 |
de-DE | yyyy | 2021 |
Below is a table of commonly used time formats:
Format | Output (Time = 9:05:24 AM) | Output (Time = 2:05:24 PM) |
---|---|---|
hh:mm | 09:05 | 02:05 |
hh:mm tt | 09:05 AM | 02:05 PM |
hh:mm:ss | 09:05:24 | 02:05:24 |
h:mm:ss | 9:05:24 | 2:05:24 |
HH:mm:ss | 09:05:24 | 14:05:24 |
HHmmss | 090524 | 140524 |
hh:mm:ss.fff | 09:05:24.123 | 02:05:24.123 |
Comments
Article is closed for comments.