Jump to content

search by datetime


jagguy

Recommended Posts

First you want to get what today - 4 weeks is

 

<?php
$LinuxToday = strtotime("now");
$ADay = 1*60 *60 *24;

$Linux4WeeksAgo = $LinuxToday - 28 * $ADay;

$DB4WeeksAgo = date("Y-m-d H:i:s", $Linux4WeeksAgo;
$Today = date("Y-m-d H:i:s");
$query = "SELECT * FROM Categories WHERE ProductsDateAdded BETWEEN '".$DB4WeeksAgo."' AND '".$Today."'";

?>

Link to comment
https://forums.phpfreaks.com/topic/43811-search-by-datetime/#findComment-212695
Share on other sites

Archived

This topic is now archived and is 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.