Пример #1
0
    public string NepaliYear()
    {
        short Nyear;
        short Nmonth;
        short Nday;

        NCCSNepaliDateLib.NepaliDateClass nepalidate = new NCCSNepaliDateLib.NepaliDateClass();
        DateTime englishDate = new DateTime();

        englishDate = DateTime.Today;
        nepalidate.SetEnglishDate(englishDate.Date);
        nepalidate.GetNepaliDate(out Nyear, out Nmonth, out Nday);
        return(Nyear.ToString());
    }
Пример #2
0
    public string GetSingleNepaliDate(string EnglishDate)
    {
        CultureInfo ci = new CultureInfo("en-GB");
        short       Nyear;
        short       Nmonth;
        short       Nday;

        NCCSNepaliDateLib.NepaliDateClass nepalidate = new NCCSNepaliDateLib.NepaliDateClass();
        DateTime englishDate = new DateTime();

        try
        {
            englishDate = Convert.ToDateTime(EnglishDate, ci);
        }
        catch
        {
            englishDate = DateTime.Today;
        }
        nepalidate.SetEnglishDate(englishDate.Date);
        nepalidate.GetNepaliDate(out Nyear, out Nmonth, out Nday);
        string NepaliDate = Nday.ToString() + "/" + Nmonth.ToString() + "/" + Nyear.ToString();

        return(NepaliDate);
    }