| | |
tomorrow date??? .
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2005
Posts: 20
Reputation:
Solved Threads: 0
I am trying to assign tomorrow date to a variable in my program call $tomorrow, but i just cant seem to work out how to do it. Have done today's one by doing
$date = date('Y-m-d');
after reseraching I thought it will make sense to do this
$tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));
but this produced a long number (1141689600). making no sense.
I want the output to be as the same format as the date function used above.
Please please please please can someone help me. Thanks in advance
$date = date('Y-m-d');
after reseraching I thought it will make sense to do this
$tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));
but this produced a long number (1141689600). making no sense.
I want the output to be as the same format as the date function used above.
Please please please please can someone help me. Thanks in advance
Troy's code will work just fine, here's another way of doing it:
[php]$tomorrow = date('Y-m-d',mktime()+86400);[/php]
[php]$tomorrow = date('Y-m-d',mktime()+86400);[/php]
•
•
•
•
Originally Posted by paradox814
Troy's code will work just fine, here's another way of doing it:
[php]$tomorrow = date('Y-m-d',mktime()+86400);[/php]
I think is better to use time() instead of mktime() in this case
And a little explanation:
date() function get's two arguments. first one is date format, second one is function time() which get the current time in UNIX format.
We can manipulate time() function with - or + time.
so 86400 is the sum for the seconds in 24hours.
24*60*60 (24 hours * 60 mins * 60 sec).
Well date function will convert UNIX time time stamp to your date format. That's is...
excuse my english it's not my native language and i hope this will help you to understand how the things work out
Винаги Ñ?е цели в луната, така и да пропуÑ?неш, пак ще Ñ?и Ñ?ред звездите!
by ludesign
by ludesign
![]() |
Similar Threads
- Java Noob Question (Java)
- How to compaire Stored Dates with System Date (PHP-MYSQL) (PHP)
- How to erase Date Last Accessed Info (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: Pagination - not displaying results properly, please help!
- Next Thread: PHP in a html page?
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date development directory display download dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parse parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql structure syntax system table thesishelp tutorial update upload url validation validator variable video web xml youtube





