Jump to content

Date Of The Next Monday


westman

Recommended Posts

this code i have...

<?php$day = date('d');$month = date('m');$year = date('Y');$nextMonday = date("Y, m, d",strtotime('next Monday',mktime(0,0,0,$month,$day,$year)));echo $nextMonday;?>

could some1 tell me what time is used here, the time from the users pc or server time.if it is the time from the users pc how do i get the time in London, UK?

Link to comment
Share on other sites

Did you check the link which justs0meguy provided above?

Link to comment
Share on other sites

which part yoy are facing problem to understand?that above function will change its timezone everytime it is ivoked.date() has two parameters first one is the date format in string and second one is integer as timestamp. by default the timestamp is current timestamp. timestamp is timezone independent. so date will just output the date in the format which you have provided in first argument according to timezone which is already set in php.ini. date_default_timezone_set() will override the timezone everytime on script execution. and let the date() provide the date according to new timezone.manual page has fare amount of example with that

Link to comment
Share on other sites

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...