If you are using php 5.3+ you can use a new way to do it.
<?php
$date = new DateTime();
echo $date->getTimestamp(). "<br>";
$date->add(new DateInterval('PT674165S')); // adds 674165 secs
echo $date->getTimestamp();
?>
More Related Contents:
- php – add two hours to date variable
- PHP store hours, closed dates [closed]
- Getting error in coding PHP [closed]
- PHP 01/01/1970 Issues with Date Fields
- Convert one date format into another in PHP
- PHP How to find the time elapsed since a date time? [duplicate]
- Convert seconds into days, hours, minutes and seconds
- Converting string to Date and DateTime
- I have 2 dates in PHP, how can I run a foreach loop to go through all of those days?
- PHP get number of week for month
- Getting date format m-d-Y H:i:s.u from milliseconds
- The first day of the current month in php using date_modify as DateTime object
- PHP: Adding months to a date, while not exceeding the last day of the month
- Calculate age based on date of birth
- php date validation
- Send PHP date to JavaScript date format
- How to find the date of a day of the week from a date using PHP?
- PHP order array by date? [duplicate]
- how to convert php date formats to GMT and vice versa?
- PHP date format converting
- Date function output in a local language [duplicate]
- How to display a date as iso 8601 format with PHP
- Get most recent date from an array of dates in “Y-m-d H:i:s” format
- Format date from database?
- MySQL, how to insert null dates
- Converting to date in PHP from yyyymmdd format
- Subtracting a certain number of hours, days, months or years from date
- How can I work with dates before 1900 in PHP?
- How do I convert an ISO8601 date to another format in PHP?
- Determine If Business Is Open/Closed Based On Business Hours