MySQLä¸ã§ãDATETIMEåã®æéå·®ãåºãæ¹æ³ã§ãã åã®å ´åãåºããå¤ãåè¨ãã¦ããã®å¾PHPã§æ±ãæµãã§ããã®ã§ãUNIX_TIMESTAMPã§å¤æãã¦ããå·®ãåºãæ¹æ³ãæ¡ç¨ãã¾ããã è¤æ°ã®æ¹æ³ã§çµæãåºãã¦ã¿ã å·¦2ã¤ã®ãã¼ã¿ã®å·®åããã«ã©ã åã®æ¹æ³ã§åºãã¦ãã¾ãã ãã®ã¾ã¾æ¸ç® æ°ååã®å·®åã«ãªãã¾ãã SELECT datetime1 - datetime2 FROM table_name UNIXTIMESTAMPåãã¦ããè¨ç® ç§æ°ã§åå¾ã§ãã¾ãã SELECT UNIX_TIMESTAMP( datetime1 ) - UNIX_TIMESTAMP( datetime2 ) FROM table_name SUBTIME()ã§è¨ç® å¾ãã®å¼æ°ã¯æå»ã§ã¯ãªãæéã表ãå¤ã§ãªããã°ãªããªãããã§ãã SELECT SUBTIME(datetime1,datetime2)
{{#tags}}- {{label}}
{{/tags}}