| Author |
Message |
Desbrina Jadeite

Joined: 11 Jun 2005 Posts: 2963 Location: Earth
|
Posted: Wed Dec 26, 2007 11:03 am Post subject: adding a week onto a date |
|
|
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
|
Posted: Wed Dec 26, 2007 12:21 pm Post subject: |
|
|
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
|
|
| Back to top |
|
| |
Kovacs Pepe El Contratado

Joined: 12 Jun 2005 Posts: 1402 Location: Leeds, UK / Guardamar Del Segura, España / Cayey, Puerto Rico
|
Posted: Wed Dec 26, 2007 1:32 pm Post subject: |
|
|
| 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  _________________ 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
|
|
| Back to top |
|
| |
|
|
|