What PHP function(s) can I use to perform operations on non-integer timestamps?

Posted by stephenhay on Stack Overflow See other posts from Stack Overflow or by stephenhay
Published on 2010-05-01T18:49:57Z Indexed on 2010/05/01 18:57 UTC
Read the original article Hit count: 125

Filed under:
|
|
|

Disclaimer, I'm not a PHP programmer, so you might find this question trivial. That's why I'm asking you!

I've got this kind of timestamp: 2010-05-10T22:00:00 (That's Y-m-d)

I would like to subtract, say, 10 days (or months, whatever) from this, and have my result be in the same format, i.e. 2010-04-30T22:00:00.

What function(s) do I need to do this in PHP?

Note: I'm using this to do a computed field in Drupal. The result will be the date that an e-mail is sent.

Bonus question: If 2010-05-10T22:00:00 means "May 10, 2010 at 10pm", is there a timestamp equivalent of "May 10, 2010 (all day)"?

Thanks everyone.

© Stack Overflow or respective owner

Related posts about php

Related posts about php5