views:

36

answers:

1

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.

+1  A: 

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);

        }
ondesertverge
seems like (not tried yet) its the approach+code that i am looking for. however, what should i do if i want to convert it back? the hebrew date is a known format? (i am VERY! new to .NET)
yossi
I would try to hide and link the Gregorian date to the Hebrew date. When a Hebrew date is chosen just look up the hidden date. If that isn't enough use the `DateTime.ParseExact()` utility to parse (exract value from text) the Hebrew date. The `format` from my code snippet should work both ways for that. If it doesn't you can write your own format provider. http://msdn.microsoft.com/en-us/library/w2sa9yss.aspx
ondesertverge
pls contact me by mail. i have a job offer for you. yossi AT dugma-co-il
yossi