locked
About changing the format of date on server RRS feed

  • Question

  • User1315566951 posted

    Hello All,

    I am using ASP.Net 3.5 with c#. And i am using ms access database. I have one table in which there is date column having the data type as datetime. Now i want to change the format of date columnn without data lost. Please suggest me any solution for this.

     

    Thanks in Advance. 

    Sunday, February 5, 2012 11:53 PM

Answers

  • User-1199946673 posted

    Dates are not stored in a particular format in a database. Best practice is to format a date in the GUI (your webpage)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 6, 2012 2:58 AM
  • User3866881 posted

    Hi priyankafanse:)

    Use a GridView or something like data presentation control+AccessDataBase is a better choice,and then to use something like:

    1)Eval("DateTimeColumnName","{0:yyyy/MM/dd}")

    2)<asp:BoundField DataField="ColName" DataFormatString="{0:yyyy/MM/dd}"……/>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 7, 2012 9:07 PM

All replies

  • User-1199946673 posted

    Dates are not stored in a particular format in a database. Best practice is to format a date in the GUI (your webpage)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 6, 2012 2:58 AM
  • User3866881 posted

    Hi priyankafanse:)

    Use a GridView or something like data presentation control+AccessDataBase is a better choice,and then to use something like:

    1)Eval("DateTimeColumnName","{0:yyyy/MM/dd}")

    2)<asp:BoundField DataField="ColName" DataFormatString="{0:yyyy/MM/dd}"……/>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 7, 2012 9:07 PM