-3

I am trying to change the default date format by the way below but the format wont change and there is no errors

I am excepting to get date in Arabic format. What I am getting now is the default system format date like this (12:00:00 03/01/2011) while I want to overwrite the system format date

Note: Working under oracle11g

TBNextDate.Text = Convert.ToDateTime(oraReder[4])
                         .ToString("hh:mm:ss dd/MM/yyyy", new CultureInfo("ar-AE"));
Balagurunathan Marimuthu
  • 2,927
  • 4
  • 31
  • 44
sam
  • 2,493
  • 6
  • 38
  • 73
  • Not an answer but:https://msdn.microsoft.com/en-us/library/5hh873ya(v=vs.90).aspx – Trey Dec 13 '16 at 19:35
  • 1
    What do you expect the output to be and what are you getting? Is `oraReder[4]` a valid date? – D Stanley Dec 13 '16 at 19:35
  • @DStanley I am excepting to get date in Arabic format.. what I am getting now is the default system format date like this (12:00:00 03/01/2011) while I want to overwrite the system format date ...and yes its valid date – sam Dec 13 '16 at 19:43

1 Answers1

1

According to MSDN:

The provider parameter defines the pattern that corresponds to the standard format specifiers, as well as the symbols and names of date and time components.

When you specify a specific format like you do that does not include any name specifiers, the only thing the culture changes is the separator symbol (e.g. / or .)

If you want to use a date pattern specific to that culture, use a standard format string instead:

TBNextDate.Text = Convert.ToDateTime(oraReder[4]).ToString("d", new CultureInfo("ar-AE"));
D Stanley
  • 149,601
  • 11
  • 178
  • 240
  • Okay that's good so far but number we still with default system format... date now appear like (03 يناير, 2011) numbers arr not format and time has been gone i tried to mix between DT or dt or and most of other parameters – sam Dec 13 '16 at 21:09