Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Exemple d’utilisation du calendrier Hijri avec Culture


{filelink=19645}

using System;
using System.Globalization;
using System.Threading;
 
public class ExampleHijri
{
    public static void Main()
    {
        HijriCalendar calHijri = new HijriCalendar();
 
        Thread.CurrentThread.CurrentCulture = new CultureInfo("ar-SY");
 
        CultureInfo maintCult = CultureInfo.CurrentCulture;
        maintCult.DateTimeFormat.Calendar = calHijri;
 
        string dFormat = maintCult.DateTimeFormat.ShortDatePattern;
 
        maintCult.DateTimeFormat.ShortDatePattern = dFormat;
        DateTime date2 = new DateTime(1432, 12, 10, calHijri);
        Console.WriteLine(maintCult.NativeName);
        Console.WriteLine(calHijri);
        Console.WriteLine(date2);
        Console.WriteLine(calHijri.GetDayOfMonth(date2));
 
    }
 
}

No comments yet.

Leave a Comment