I have a multilingual website and I need to show the date in this format Wednesday, May 22, 2013
. I use following line of code to display dates
DateTime.UtcNow.ToString("D");
That doesn't work when I use this along with Culture info
It then shows me dates in this format مايو 2013,22
How can I show date in arabic in format year, date month day
I am not sure why DateTime.UtcNow.ToString("D");
is not able to convert to arabic date with weekdays
UPDATE : this works DateTime.Now.ToString("dd dddd , MMMM, yyyy", new CultureInfo("ar-AE"))
You can specify the format explicitly:
DateTime.UtcNow.ToString("dddd, MMMM dd, yyyy");
This will output, for example:
Wednesday, May 22, 2013
A lowercase 'd' stands for the day, two 'd's for the day with a zero in front if applicable, three 'd's for the abbreviation of the name of the day and four 'd's for the complete name of the day. The same applies to the months with a capital 'M' (lowercase 'm' are minutes!).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With