Jump to content

Recommended Posts

try:
[code]<?php echo date('F j, Y',strtotime('next Sunday')); ?>[/code]
or
[code]<?php echo date('F j, Y',strtotime('this Sunday')); ?>[/code]
Sometimes PHP thinks that "this Sunday" and "next Sunday" are different, so see which one works for you.

Ken
Link to comment
https://forums.phpfreaks.com/topic/14649-next-sunday/#findComment-58355
Share on other sites

Thanks alot kenrbnsn. But what do you mean about the this Sunday and next Sunday thing?

pixy, that's just MySQL, and they would only work if I determine what day it currently is first.

Also, is there a way to get 2 sundays from now. I'm using MySQL to select anything that is in between the upcoming sunday and a week from that (or "Sunday to a week from Sunday"). I don't need the SQL or anything, but how would I get "a week from Sunday" using strtotime()?
Link to comment
https://forums.phpfreaks.com/topic/14649-next-sunday/#findComment-58364
Share on other sites

[quote author=johnnyk link=topic=100641.msg397535#msg397535 date=1152936664]Also, is there a way to get 2 sundays from now....but how would I get "a week from Sunday" using strtotime()?
[/quote]

I'd look at the date() and strtotime() functions in the manual.  This is php help, not php helpless :)
Link to comment
https://forums.phpfreaks.com/topic/14649-next-sunday/#findComment-58369
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.