开发者

Arabic date displaying incorrectly

开发者 https://www.devze.com 2023-02-19 04:49 出处:网络
I\'m using the following code to display an arabic date: Dim dtFormat As DateTimeFormatInfo = New CultureInfo(\"ar-sa\", False).DateTimeFormat

I'm using the following code to display an arabic date:

Dim dtFormat As DateTimeFormatInfo = New CultureInfo("ar-sa", False).DateTimeFormat
dtFormat.Calendar = New HijriCalendar()

Dim hijriDate As String = Now.ToString("d MMMM yyyy", dtFormat)

Today this is displaying as 16 ربيع الثاني 1432. However, according to a user, the arabic text shou开发者_StackOverflowld be in the middle with the year 1432 at the end.

However, when you highlight the text, it highlights back to front.

What am I doing wrong?


This is a known problem with "right to left" Arabic text when it gets mixed in with numbers. How are you displaying it? If you are using a windows control make sure that the RightToLeft property is set to true. If it's web; use css style direction:rtl;

0

精彩评论

暂无评论...
验证码 换一张
取 消