Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Standards and Best Practices Databases and International Concerns Working with DateTime

Sue Dough
Sue Dough
35,800 Points

Output date does not make sense to me in the video

I see you add two weeks to the output in the video. The output date displays 9/22/2014 and then you go back to 9/12/2014. That is 10 days. 2 weeks is more than 10 days so why is this?

Tomasz Budny
Tomasz Budny
14,588 Points

I'm guessing it's an error in the video montage :)

It looks like the date changes from 9/22/2014 to 9/12/2014 but it's actually the browser tab being closed, revealing the result of the previous run.

Also, the script doesn't add two weeks to the previous date. It's creating a new object set to two weeks from 'now', 'now' being the time the command was executed.

I hope that helps clear it up! :)