How can I add second(s) in a date time. ex. I have date time 2009-01-14 06:38:18 I need to add -750 seconds in that date and want result in datetime
You need to convert that date to a unix timestamp, where such operations are trivial:
$unix_timestamp = strtotime('2009-01-14 06:38:18'); $new_string = date('Y-m-d H:i:s', $unix_timestamp - 750);