date_sub is not working

Posted by TIT on Stack Overflow See other posts from Stack Overflow or by TIT
Published on 2010-05-24T02:05:01Z Indexed on 2010/05/24 2:10 UTC
Read the original article Hit count: 375

Filed under:
|

As my server is not upgreaded to php 5.3 (it is in PHP Version 5.2.11) date_sub is not working.

here is the code: $date = date_create(date('Y-m-d')); date_sub($date, date_interval_create_from_date_string('60 days')); $date1= date_format($date, 'Y-m-d');

but its ok in my localhost(which is in 5.3), but not in server(5.2.11).

Can you please tell me how can i make this date subtraction working on 5.2.11 ?

© Stack Overflow or respective owner

Related posts about php

Related posts about date