yossi
yossi

Reputation: 3164

Working with WPF(C#) calendar control, hebrew and georgian dates conversion

I need to build a simple app, A calendar with notes, working with a simple db and standard calendar is easy. the problem is with a feature that i must add:

I need that every note will have a Hebrew date and Georgian date; It should work "on the fly", meaning: a user will have the ability to add a note based on a date type of his choice, Georgian or Hebrew, and the app will do the magic in the background.

the db will work with Georgian dates only so no conversion is needed there.

I need (and lots of searching helped very little) a tutorial for that, any kind of help will do.

Upvotes: 3

Views: 1433

Answers (1)

David Perlman
David Perlman

Reputation: 1470

How about this?

private static string GetHebDate(DateTime date, string format)
        {

            System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("he-IL");
            ci.DateTimeFormat.Calendar = new System.Globalization.HebrewCalendar();
            return date.ToString(format, ci);

        }

Upvotes: 5

Related Questions