Display the date in Arabic in this format "Wednesday, May 22, 2013"

I have a multilingual website and need to show the date in this format Wednesday, May 22, 2013 . I use the following line of code to display dates

 DateTime.UtcNow.ToString("D"); 

It doesn’t work when I use it with cultural information.

Then he shows me the dates in this format Ω…Ψ§ΩŠΩˆ 2013,22

How to show the date in Arabic format in the format year, date month day

I am not sure why DateTime.UtcNow.ToString("D"); cannot convert to arabic date with weekdays

UPDATE: works DateTime.Now.ToString("dd dddd , MMMM, yyyy", new CultureInfo("ar-AE"))

+8
date c #
source share
1 answer

You can explicitly specify the format:

 DateTime.UtcNow.ToString("dddd, MMMM dd, yyyy"); 

This will output, for example:

 Wednesday, May 22, 2013 

The bottom line 'd' indicates a day, two days for a day with a zero edge, if applicable, three 'd for the abbreviation of the day name and four' d for the full name of the day. The same applies to months with capital β€œM” (lowercase β€œm” "- minutes!).

+5
source share

All Articles