Re: dates
| From: | Julian Rockey | Date: | Mon, 19 Feb 2001 01:54:02 +0000 |
| Subject: | Re: dates | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40491@lists.php.net to get a copy of this message | ||
Yes I had a look at mktime() and date() and tried to think of an easy way to do it but couldn't... you can convert both dates to a UNIX timestamp (millseconds after whatever date) then do a subtraction... and then what? Easy to work out number of days from millseconds as a day's length is fixed but to go to months is harder as of course you need more information than just the actual elapsed time. Similar problam with mktime() as it's designed for actual dates, not differences between days.
What is XEmacs calc- mode and calendar mode? I'm not all that familiar with Unix I'm afraid..
Thanks for your reply!
Julian
eschmid+sic@s.netic.de wrote:
On Sun, Feb 18, 2001 at 04:40:08PM -0700, Julian Rockeu wrote:Anyone know how to use the PHP date functions to work out the difference between two timestamps? For example.. Figure out the number of seconds, minutes, hours, days, months and years between 5th October 2001 14:20:10 and 26th February 1998 109:54:10This should be doable with http://php.net/mktime and http://php.net/date. But for such heavy calculations I prefer XEmacs calc-mode or the calendarr-mode. -Egon