Jump to content

[SOLVED] Parsing a date


johng

Recommended Posts

Thank you both very much!  Do you know if there is any way that I would be able to put that back into the same date format, only adding one day?  I tried using mktime, but it apparently doesn't like variables.  Or if you know of an easier way, that would be awesome!

 

Thanks!

Here's the code I tried to use:

 

 <?php 
list($year, $month, $day) = explode("-", $eserve_date);

echo "Year: ".$year."<br>Month: ".$month."<br>Day: ".$day;
$cst_date = date("Y-m-d", mktime(0,0,0, "$month", "$day", "$year");
?>

 

Before I did the last line, it ran just fine, and had numbers in $month, $day, and $year.

Link to comment
https://forums.phpfreaks.com/topic/40534-solved-parsing-a-date/#findComment-196177
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.