Jump to content

Timestamp


rashmi_k28

Recommended Posts

How to query for one day interval and exclude the seconds of timestamp

 

 

If the current timestamp is $time='2008-08-13 14:00:02'; and if for the previous day for the 14hrs if the timestamp updated as '2008-08-13 14:00:01'. The data at the this '2008-08-12 14:00:01' is excluded when queried as below.

 

So how to avoid it by using the query excluding seconds in the timestamp and considering only '2008-08-13 14:00' from the timestamp.

 

 

select timestamp, fieldname from table where timestamp <= ('".$time."') and timestamp >= date_sub('".$time."',interval 1 day) order by timestamp

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.