convert date christian date to persian date

Rate It (2)

Last post 10-30-2009 5:37 AM by leena.d.patil. 5 replies.

Sort Posts:

  • convert date christian date to persian date

    08-11-2008, 6:02 AM
    • Member
      43 point Member
    • sepid
    • Member since 04-06-2008, 8:32 AM
    • Posts 210

    hi,

    I need to convert christain date that was produced in my Sql database to persian date like" دوشنبه 21 مرداد 1378" in a datalist.Could you recommend me any function.I use VisualStudio 2005 & VB.

    thanks in advance

    Sepid

  • Re: convert date christian date to persian date

    08-11-2008, 6:51 AM
    • Star
      7,715 point Star
    • jeremyh
    • Member since 01-23-2003, 12:14 PM
    • York, England
    • Posts 1,380
    Regards
    Jeremy
    If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
    That way future readers will know which post solved your issue.
  • Re: convert date christian date to persian date

    08-19-2008, 1:53 PM
    • Member
      2 point Member
    • eddy_eclectic
    • Member since 07-26-2008, 6:20 PM
    • Posts 1

     If you search Yahoo! or Google it you may easily find it.

    But you may download PersianDate Web Control at PersianDate.ir, this is exactly what you are looking for.

     After installation is completed then try this source:

     

    1    <asp:DataList ID="DataList1" runat="server" DataSourceID="YourSqlDataSource">
    2 <ItemTemplate>
    3
    4 <%-- Remember that whenever you are displaying a specific date change AutoUpdate to false --%>
    5 <sim:PersianDate ID="PersianDate1" runat="server"
    6 AutoUpdate="false" DateValue='<%# Eval("Column_Name_of_Your_Date_Values") %>' />
    7
    8 </ItemTemplate>
    9 </asp:DataList>
      I assumed you are using SqlDataSource

      



     


     
    Filed under:
  • Re: convert date christian date to persian date

    08-29-2008, 6:00 AM
    • Member
      43 point Member
    • sepid
    • Member since 04-06-2008, 8:32 AM
    • Posts 210

    Hi eddy,

    Thanks for your reply ,

    I couldn't register in the site you recommended to get  the component.And I don't want to have a  trail version.

    Could you please help me.

    Sepid 

  • Re: convert date christian date to persian date

    10-28-2009, 4:50 PM
    • Member
      42 point Member
    • uniservice3
    • Member since 10-16-2009, 6:59 AM
    • Posts 54

    hi

    you can use from my code 

    using

    System;

    using

    System.Data;

    using

    System.Configuration;

    using

    System.Web;

    using

    System.Web.Security;

    using

    System.Web.UI;

    using

    System.Web.UI.WebControls;

    using

    System.Web.UI.WebControls.WebParts;

    using

    System.Web.UI.HtmlControls;

    using

    System.Globalization;

    ///

    ///

    <summary> Summary description for DateTime1

    ///

    </summary>

    public

    class DateTime1

    {

     

     

     

     

    {

     

     

    _ToDay = newcal.GetDayOfWeek(

    _Month = newcal.GetMonth(

     

    {

     

    _Month =

     

     

    _Month =

     

     

    _Month =

     

     

    _Month =

     

     

    _Month =

     

     

    _Month =

     

     

    _Month =

     

     

    _Month =

     

     

    _Month =

     

     

    _Month =

     

     

    _Month =

     

     

    _Month =

     

    }

     

     

    {

     

    _ToDay =

     

     

    _ToDay =

     

     

    _ToDay =

     

     

    _ToDay =

     

     

    _ToDay =

     

     

    _ToDay=

     

     

    _ToDay=

     

    }

    _Date = _Month +

    _Day = _ToDay;

    }

    public string _Day;

    public string _Date;

    public string _Month;

    public void Get_Date_Time()string _ToDay;PersianCalendar newcal = new PersianCalendar();DateTime.Now).ToString();DateTime.Now).ToString();switch (_Month)case "1":"فروردین";break;case "2":"اردیبهشت";break;case "3":"خرداد";break;case "4":"تیر";break;case "5":"مرداد";break;case "6":"شهریور";break;case "7":"مهره";break;case "8":"آبان";break;case "9":"آذر";break;case "10":"دی";break;case "11":"بهمن";break;case "12":"اسفند";break;switch(_ToDay)case "Sunday":"یکشنبه";break;case "Monday":"دوشنبه";break;case "Tuesday":"سه شنبه";break;case "Wednesday":"چهارشنبه";break;case "Thursday":"پنجشنبه";break;case "Friday":"جمعه";break;case "Saturday":"شنبه";break;" " + newcal.GetYear(DateTime.Now).ToString();

     

  • Re: convert date christian date to persian date

    10-30-2009, 5:37 AM
    • Member
      362 point Member
    • leena.d.patil
    • Member since 07-15-2009, 6:31 AM
    • Pune
    • Posts 65

    Hi,

    Please refer this-

    http://www.codeproject.com/KB/datetime/hijrigregorianclass.aspx?msg=2749584

    Hope this will help you. 

    Regards,
    Leena


    Please remember to mark replies as answers if you find them useful.
Page 1 of 1 (6 items)
Microsoft Communities