Home > Questions and Answers > General Questions

Tomorrow’s Date Script? (6)


10-04-2011 01:30 PM #1 stevenbell (Member)
Tomorrow’s Date Script?

Hey everyone, I want to add the "Tomorrow’s Date Script" to my landing page, but I don't know how to use the php script into my landing page html, can you help me, thank you very much!


10-04-2011 02:23 PM #2 bbrock32 (Administrator)

Here you go :

[PHP]
$tomorrow = mktime(0, 0, 0, date("m"), date("d")+1, date("y"));
echo "Tomorrow is ".date("m/d/y", $tomorrow);
[/PHP]


10-04-2011 02:54 PM #3 kyleirwin (Member)

Not that it really matters, but I think this is a more elegant solution...
[php]
echo 'Tomorrow is '.date('m/d/y',strtotime('now +1 day'));
[/php]


10-04-2011 03:08 PM #4 stevenbell (Member)

Thank you bbrock32 and kyleirwin, I need to use iframe in html? Can't use directly? Like JS.


10-05-2011 03:32 PM #5 kyleirwin (Member)

You can use it "directly" in this fashion...

HTML Code:
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Page Header</h1>
<p>Yesterday's date is <?php echo date('m/d/y',strtotime('now +1 day')); ?></p>
</body>
</html>


11-10-2011 08:04 AM #6 minh1204 (Member)

How would we change the format of the date to show November 11, 2011 or just November 11?

I'm using this script <?php echo date('m/d/y',strtotime('now +1 day')); ?>

Nevermind. I ended up using the script from the link in the OP

<?PHP $now = time(); $tomorrow = $now + 86400; echo date('F jS, Y',$tomorrow);?>
Shows: November 11th, 2011

You can change the format by changing 'F jS, Y' with the format characters from
http://jacwright.com/projects/javascript/date_format/


Home > Questions and Answers > General Questions