Jump to content

diffrence between two dates


Destramic

Recommended Posts

hey days im trying to get the differnce between the two dates but

 

		$start_date      = new DateTime($start_date);
	$todays_date     = new DateTime("now");

	$interval = $start_date->diff($todays_date);
	echo $interval->format('%R%a days');

 

but the error im getting is

 

Fatal error: Call to undefined method DateTime::diff()  i dont see what im doing wrong if someone could help please

 

thank you

Link to comment
Share on other sites

ok all updated and these errors come up which i never seen before

 

Fatal error:  Uncaught exception 'Exception' with message 'DateTime::__construct() [<a href='datetime.--construct'>datetime.--construct</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '1.0/DST' instead' in C:\www\private\application\controllers\tournaments_controller.class.php:30
Stack trace:
#0 C:\www\private\application\controllers\tournaments_controller.class.php(30): DateTime->__construct('2011-10-06')
#1 [internal function]: Tournaments_Controller->tournament('counter-strike', 'test')
#2 C:\www\private\library\action\action.class.php(47): call_user_func_array(Array, Array)
#3 C:\www\private\library\dispatcher\dispatcher.class.php(101): Action->dispatch('tournament', Array)
#4 C:\www\private\library\front_controller\front_controller.class.php(132):  in <b>C:\www\private\application\controllers\tournaments_controller.class.php</b> on line <b>30</b><br />

 

help please  :-[

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.