how i can to save date to Hijri in sql using C#

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
hi all,
i want to save date in database in Hijri
i try to use
<pre class="prettyprint CultureInfo lebaneseCulture = new CultureInfo("ar-SA");
Calendar originalCalendar = lebaneseCulture.Calendar;
string message = null;

bool supported = false;
foreach (Calendar supportedCal in lebaneseCulture.OptionalCalendars)
{
if (supportedCal.ToString() == "System.Globalization.HijriCalendar")
{
supported = true;
lebaneseCulture.DateTimeFormat.Calendar = supportedCal;

Thread.CurrentThread.CurrentCulture = lebaneseCulture;
Thread.CurrentThread.CurrentCulture.DateTimeFormat = lebaneseCulture.DateTimeFormat;

break;
}

}[/code]
<br/>
It actually Change date in c# but when save to database i find date in <span style="color:#333333; font-family:Segoe UI,Lucida Grande,Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left Gregorian format
<br/>


View the full article
 
Back
Top