| | |
create date??
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2008
Posts: 293
Reputation:
Solved Threads: 11
In my variable
$time=2008-12-19 14:12:10 this value is in database
and
duration to find next date is 21157 in seconds
$event_length=21157
Suppose today's date is 2008-12-21
How to find next date by using $time value??
So my problem is How to find next time and date??
$time=2008-12-19 14:12:10 this value is in database
and
duration to find next date is 21157 in seconds
$event_length=21157
Suppose today's date is 2008-12-21
How to find next date by using $time value??
$timestamp = strtotime("$time");
$etime = strtotime("+$event_length seconds", $timestamp);
$next_time = date('Y:m:d H:i:s', $etime); //here date get's today's date •
•
Join Date: Jun 2008
Posts: 62
Reputation:
Solved Threads: 3
in your example, You have already converted your date to a timestamp and have the event length in seconds, so just add the seconds to the timestamp. Here, Try This...
Hope It Helps.
PHP Syntax (Toggle Plain Text)
$timestamp = strtotime("$time"); $etime = $timestamp+$event_length; $next_time = date('Y:m:d H:i:s', $etime); //here date get's today's date
There are alot of people smarter than me, BUT at least I try to be of some help. Of coarse I'm not perfect, I need help too.
![]() |
Similar Threads
- Passing data from forms from one page to another (JavaScript / DHTML / AJAX)
- How to Add date to file Name (Windows NT / 2000 / XP)
- Set date to 0? (Visual Basic 4 / 5 / 6)
- DATE problem. (Java)
- Hi Access Date Problem (> Now +7 Days And < Now +2 Months) (Computer Science)
- Aurora / Norton Renewal Date (Viruses, Spyware and other Nasties)
- How To create A Detail Account Querry Sorted By Date (MS Access and FileMaker Pro)
- Ms Sql 2000 (MS SQL)
Other Threads in the PHP Forum
- Previous Thread: populate select list from multiple Mysql tables
- Next Thread: Display mysql data
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary body broken cakephp checkbox class cms code cron curl database date date/time directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link list login loop mail menu mlm mod_rewrite msqli_multi_query multiple mycodeisbad mysql oop parameter parse paypal pdf php problem query radio random recursion regex remote script search seo server sessions sms soap source space sql static structure syntax system table tutorial update upload url validation validator variable video web webdesign wordpress xml youtube





