Jump to content

Getting a Specific Date


yarub

Recommended Posts

What's the easiest way to figure out the time() for a date infront of you. Today is Monday. What's the easiest way to go about getting the time() for Saturday? An array or query or whatever that would work for any day of the week to figure out when Saturday is.

Link to comment
Share on other sites

Not really. =\  I want it to automatically find it for any day. So if it's Thursday, I want it to know that Saturday is only two days away. If it's Sunday, I want it to know that Saturday is six days away.

Link to comment
Share on other sites

sorry made an error, I changed it but...

 


if ($day == 7)

{

$daysLeft = 7;

}

else

{

$daysLeft = 6 - $day;

}


it was 8 before, but it doesn't take 8 days to get from sunday to saturday.

and I forgot to put a double "=" :P (I'm not good at programming on a forum. phpDesigner FTW!

 

Also, I would recommend you check php.net first before you post here, there's a lot there that can help you :)

The whole fun of programming lies in solving your problems (well that's what I think), not in just getting the code presented

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.