Can any one give me some idea regarding how to calculate second and fourth saturdays i did based on time whenever i change system time it results in tuesdays insetad of saturdays.
srilakshmitr7
6
Light Poster
Recommended Answers
Jump to PostMaybe check the examples at date() and time() functions at php.net?
Maybe example of your problem would help also.
Jump to PostThe strtotime function is useful for this sort of thing. Here is a little routine that calculates the 2nd and 4th Saturdays in May (as an example):
<?PHP $wk = strtotime ("first saturday may 2009"); if ($wk == false) { echo "<br>Not able to interpret the …
Jump to Postyes strtotime function is perfect of time calculations.
For example
$today=date('Y-m-d');// for example today is 2009-04-06 $newdate=strtotime ($today);// converted to strtotime $newdate1= $newdate+ (3600*24*7); // add 7 days $newdate2= $newdate+ (3600*24*14); // add 14 days $day= date ("D",$newdate1); // DAY after 7 days $day2= date ("D",$newdate2); …
All 11 Replies
OmniX
21
Practically a Master Poster
chrishea
182
Nearly a Posting Virtuoso
BzzBee
5
Posting Whiz
srilakshmitr7
6
Light Poster
BzzBee
5
Posting Whiz
srilakshmitr7
6
Light Poster
BzzBee
5
Posting Whiz
BzzBee
5
Posting Whiz
BzzBee
5
Posting Whiz
OmniX
21
Practically a Master Poster
srilakshmitr7
6
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.