1
+---------+---------------------+---------------------+
| area_id | date_1 | date_2 |
+---------+---------------------+---------------------+
| NULL | 2012-06-28 10:09:18 | 2012-06-28 10:15:48 |
| 18 | 2012-06-28 10:15:48 | 2012-06-28 10:20:26 |
| 21 | 2012-06-28 10:20:26 | 2012-06-28 10:32:51 |
| 3 | 2012-06-28 10:32:51 | 2012-06-28 10:50:27 |
| 21 | 2012-06-28 10:50:27 | 2012-06-28 11:36:36 |
| 18 | 2012-06-28 11:36:36 | 2012-06-28 11:39:26 |
| 21 | 2012-06-28 11:39:26 | 2012-06-28 11:40:33 |
| 3 | 2012-06-28 11:40:33 | 2012-06-28 11:48:03 |
| 7 | 2012-06-28 11:48:03 | NULL |
+---------+---------------------+---------------------+
請範圍helpme的AREA_ID beetwen日期1和日期2如何從當前日期和python查詢日期時間查找時間差異?
datetime.now() - date_2
感謝
http://whathaveyoutried.com/ – Marcin 2012-07-10 16:53:35
你寫的幾乎是我會做的。如果你從另一個'datetime'中減去'datetime',你會得到一個'timedelta'對象,告訴你確切的區別。 – poke 2012-07-10 16:58:12