| | |
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: 297
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
Views: 790 | Replies: 1
| 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 datepart 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 jquery limit link list login loop mail menu methods mlm mod_rewrite multiple mysql oop parse password paypal pdf php problem query radio random recursion regex remote script search select seo server sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web webdesign xml youtube





