I want to be able to shift time if a $_GET[‘date’] is set.
Here is the code.
if(isset($_GET['date']) && $_GET['date'] !="") {
$date =time ();
}else {
$date =time ();
}
I’d like to be able to feed a year & month value through date and still have date equal time but with the time value shifted to the appropriate month and year.
What is the best what to go about this?
I would recommend deconstructing the timestamp and then use mktime(…) to reconstruct it with the “fields” of your choosing. You can extract individual “fields” with getdate() or even with date().