douqipi9704 2011-04-11 15:35
浏览 241
已采纳

如何在mysql中重新格式化datetime?

QUESTION 1 : I am using datetime to store the date and time in MySQL. I use MySQL Now() function to insert datetime. How do I store the the date using a different format? From : Year-Month-Day Hour:Mins:Sec to : Day-Month-Year Hour:Mins:Sec.

QUESTION 2 : How can I retrieve only a specified part (day, month, year, etc.) of the date stored above?

  • 写回答

4条回答 默认 最新

  • dtwbp26022 2011-04-11 15:41
    关注

    You did not understand, mysql accept date format only in yyyy-mm-dd. you can not change the standard of mysql.

    Although you can retrieve date in different format using mysql in-built functions.

    Look at the date and time functions of mysql you can retrieve date in any format then why do you need to change the storage format.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题