Lifelesspeople.com

 Forum FAQsForum FAQs  Knowledge BaseKnowledge Base  RulesRules   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   HostingHosting   RegisterRegister 
 DonateDonate   WikiWiki   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

adding a week onto a date

 
Lifelesspeople.com Forum Index -> Web Architects' Abode
Post new topic   Reply to topic View previous topic :: View next topic  
Author Message
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2963
Location: Earth

PostPosted: Wed Dec 26, 2007 11:03 am    Post subject: adding a week onto a date Reply with quote

I'm trying to add a week onto a user defined date

The first date is fine, the problem i'm having is with adding a week onto it

The date is stored into a variable
Code:
$date = $_POST['start'];


The format of the date given in the $_POST['start'] is
4 Figure Year-2 Figure Month-2 Figure Day

How do i then add 1 week onto the date?
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
LP-SolidRaven
Dictator of the Dump


Joined: 06 Jun 2004
Posts: 7032
Location: The cheese is made out of moon

PostPosted: Wed Dec 26, 2007 12:21 pm    Post subject: Reply with quote

Convert it to a unix timestamp with strtotime() add 7*24*60*60 to it (7 days * 24 hours * 60 minutes * 60 seconds) and convert it back if you need it in a readable way.
_________________
Quote:

<bart416> I just realized something
<bart416> we celebrate the fact that this piece of rock made one rotation around a glowing ball of plasma that is kept together due to its own gravity well
<njsg> HAPPY NEW YEAR
<Easter> ^^
Back to top
 
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2963
Location: Earth

PostPosted: Wed Dec 26, 2007 1:26 pm    Post subject: Reply with quote

thanks, i have it working.

One thing thats confusing me is 7*24*60*60

I know you need the 24*60*60 but but have never been sure why
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
Kovacs
Pepe El Contratado


Joined: 12 Jun 2005
Posts: 1402
Location: Leeds, UK / Guardamar Del Segura, España / Cayey, Puerto Rico

PostPosted: Wed Dec 26, 2007 1:32 pm    Post subject: Reply with quote

Desbrina wrote:
thanks, i have it working.

One thing thats confusing me is 7*24*60*60

I know you need the 24*60*60 but but have never been sure why


You're adding a week on... 7*24*60*60 gives you a week in seconds Wink
_________________
I Love Rebecca More Than Anything In The World <3
Yo Amo A Rebecca Más Que Nada En El Mundo <3
Back to top
 
Desbrina
Jadeite


Joined: 11 Jun 2005
Posts: 2963
Location: Earth

PostPosted: Wed Dec 26, 2007 1:44 pm    Post subject: Reply with quote

ah, so its in seconds, i always wondered what that was about
_________________
Midnight Tempest - A Sailor Moon TCG
Balanced Force - A Star Wars TCG
Back to top
 
Display posts from previous:   
Post new topic   Reply to topic    Lifelesspeople.com Forum Index -> Web Architects' Abode All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Home | Hosting | News | Forum | Links | System Status | About | Archive | Donate ]
Powered by phpBB © 2001, 2002 phpBB Group
All trademarks and copyrights on this page are owned by their respective owners. Posts and comments are owned by the poster. Everything else © 2001 - 2007 Lifelesspeople.com