Doubt in DateFormat

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Geethu03
    New Member
    • Dec 2006
    • 45

    #1

    Doubt in DateFormat

    Hello
    In my table Date field contains the datatype Date.but i want to change the DateFormat as i requried,for this i used date_format(dat e,'%d-%m-%Y')

    The %m starts with the (00-12) In this 00 denotes which month. I want to store 01-12 (not 00-12 ) months.

    How can i do this ,i already change the date format with the above query but in that the 12th month denotes as 00. how can i change it.

    Please any one help to do this

    Thanks and Regards,
    Geethu02
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Are you saying that with the date 2007-12-25 this
    Code:
    date_format(date,'%d-%m-%Y')
    returns 25-00-2007. If so the problems lies elswhere in your database

    Comment

    • Geethu03
      New Member
      • Dec 2006
      • 45

      #3
      Originally posted by code green
      Are you saying that with the date 2007-12-25 this
      Code:
      date_format(date,'%d-%m-%Y')
      returns 25-00-2007. If so the problems lies elswhere in your database
      I am not understand,Data base Problem means what?

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        I mean the problem is not with your DATE_FORMAT command.
        Code:
        date_format(date,'%d-%m-%Y')
        Should not produce 00 for December from a date field. Are you sure the field is of data type 'date'? Do you manipulate the field data before using DATE_FORMAT?

        Comment

        Working...