PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Those variables are pulled from a database which isn't a script I made and I don't really want to mess with it
It's going to be kinda difficult (impossible) to do this without adding some code though... How were you hoping to achieve this if not by adding a couple more lines of code?
DynamiteHost wrote:What I meant by my last post is I don't want to go changing the date format which is put into the database.
I'm not sure why you think anybody is telling you (or giving you code) to do that. The code that's been posted deals with the variables once they been taken from the database and just formats them in the way that you wanted to.
DynamiteHost wrote:I don't mind adding code which will apply when the variable is pulled from the database.
Then try the code that's been posted. They really have given you the solution that you are looking for.
because mktime doesn't like strings and you're passing in a month name and not a month number... Why passing in a string causes that paticular date to be chosen I don't know, probably has to do with its integer representation.....
Try
<?php
$hour = date("H",time());
$day = date("d",time());
$month = date("m",time()); // month number not Name
$year = date("Y",time()); // four digit year
echo date("d/M/y",mktime($hour+1,0,0,$month,$day,$year));
?>