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 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试