storing date in the format date('YmdGis')

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • omerbutt
    Contributor
    • Nov 2006
    • 638

    #1

    storing date in the format date('YmdGis')

    hi i need to store the date in the format date('YmdGis') the problem is that locally it is working perfect but when i go live it stops storing the date in this format , although it does store the date('YmdHis')

    [LOCAL CONFIGURATIONS]

    MYSQL Server version: 5.0.41-community-nt
    MySQL client version: 5.0.41

    [LIVE CONFIGURATIONS]

    Server version: 5.0.91-community
    MySQL client version: 4.1.22


    any idea ? i think i need to upgrade the msql CLIENT VERSION ON MY SITE, isnt it?
    regards,
    Omer Aslam
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Hi Omer,

    MySQL always store the date in YYYY-MM-DD format and you can not change that. I don't think there is any need to store the date in your format. Why don't you save the date in YYYY-MM-DD format and use DATE_FORMAT() function to display the date in your desired format?

    If you must have to store date in this format, then you must have to change the data type of the column. Make sure you have the same data type on local and online servers.

    Comment

    • omerbutt
      Contributor
      • Nov 2006
      • 638

      #3
      use data type DATETIME to save the date and time ,
      i need to show the actual amount of minutee / hours/days/weeks/months/years ago the schedule was uploaded.
      my server didnot supported it i used the YmdHis now .

      Comment

      Working...