Sunday, March 23, 2014

Comparing Dates

When comparing dates as a value in the query it looks like this

`created` < '2014-03-01 23:25:03'

or

`created` >= '2014-02-23 23:25:03'

 

Is that the best way? '2014-03-01 23:25:03' does not look numical.

Or is it best to save that created value as strtotime() so you actually have a numerical value.

1393716303 since comparing if something is great / less than seems more appropriate.

 

I have tried both ways and each worked out exactly the same but just wondering which would be the best method and why?

 

Thanks,

Dave

No comments: