Date converter for linux

Tushar Neupaney tushar.neupaney at gmail.com
Mon May 19 14:40:07 BST 2008


Dear all,

Thanks for your reply. As per your request here is the code:

// डेट्स नामक स्वरुप बनाएर मितीहरुलाई यस्मै प्रविष्ठ गरिनेछ

    struct Dates
        {
            public int year;
            public int month;
            public int day;
            public int dtype;
        };

    // मिती परिवर्तन गर्ने मुख्य सुत्र

    public void DateToConvert(int y, int m, int dy, int DateType)
        {

            // यदि नेपालीमा मिती परिवर्तन गर्नु परेमा

            if(DateType==1){

                y     = y + 56; // विक्रम सम्वतलाई ५६ ले जोड्दा
                m     = m + 8;  // महिनामा ८ जोड्दा
                dy    = dy + 18; // दिनमा १८ जोड्दा

            }

            // यदि अङ्ग्रेजीमा मिती परिवर्तन गर्नुपरेमा

            else if(DateType==2)
            {
                y    = y - 56; // विक्रम सम्वतलाई ५६ ले घटाईँदैछ
                m    = m - 8;  // महिनालाई ८ ले घटाईँदैछ
                dy    = dy -18; // दिनलाई १८ ले घटाईँदैछ

            }

            if(dy<=0){dy= 30- System.Math.Abs(dy);m= m -1;}
            if(m<=0){m= 12- System.Math.Abs(m);y= y-1;}

            if(dy>30){dy= 30- dy; m=m+1;}
            if(m>12){m=12- m; m=System.Math.Abs(m);y= y+1;}

            m=System.Math.Abs(m); y=System.Math.Abs(y);
dy=System.Math.Abs(dy);

            // म अब तपाईँहरुलाई प्रतिफल दिँदैछु

            MessageBox.Show(y + "/" + m + "/" + dy);

        }


Thanks in advance.

This is not the real conversion utility as it gives bias results and I don't
want to use a database. I need a code? is it possible?

Tushar.



2008/5/19 Bibek Shrestha <bibekshrestha at gmail.com>:

> DO you have the code hosted somewhere,
> is it free software?
>
>
>
> On Mon, May 19, 2008 at 5:55 PM, rajesh aryal <rajgiant at gmail.com> wrote:
> > no one is talking... tushar bro, maybe put a line of code that is
> > problametic and someone can look?
> >
> >> Dear All,
> >>
> >> I need a help. I have developed a date converter (From Nepali to
> English,
> >> English to Nepali). I have used Mono (C#) so it works in linux, Mac OSX
> and
> >> Windows all at once.
> >>
> >> Can anyone help me with the conversion. Some times the results are not
> what
> >> I want.
> >>
> >> Wishes,
> >> Tushar.
> >
> >> --
> >> Ubuntu-np mailing list
> >> Ubuntu-np at lists.ubuntu.com
> >> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-np
> >
> >
> > --
> > Ubuntu-np mailing list
> > Ubuntu-np at lists.ubuntu.com
> > Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-np
> >
>
>
>
> --
> Bibek Shrestha
> bibekshrestha at gmail dot com
> --
> YoungInnovations Pvt. Ltd.
> GPO 8976 EPC 241
> Thamel Kathmandu, Nepal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/ubuntu-np/attachments/20080519/e0ff43b8/attachment-0001.htm 


More information about the Ubuntu-np mailing list