PHP unix timestamp generator

Generate a Unix timestamp from validated input

Validate the selected date before creating its timestamp. checkdate() can validate the month, day and year before mktime() is called.

$month = 9;
$day = 14;
$year = 2026;

if (checkdate($month, $day, $year)) {
    $timestamp = mktime(12, 0, 0, $month, $day, $year);
    echo $timestamp;
}

This current example appears first; the detailed examples below are retained and modernized for comparison and additional use cases.

Time Stamp .. here

Hr

Min

Sec


Select a date from Calendar, Select Hour , Minutes and Seconds from the three sliders.
OR
You can use the dropdown list boxes below to select date and time and then generate the timestamp.

What is Unix time stamp ?

This is a way to describe time elapsed since 1st Jan 1970 to present date or any other date. This is given in seconds ( elapsed ).

We used mktime() function to generate timestamp

Other ways to get Unix Timestamp

Function Description
mktime() getting time stamp of input date and time
strtotime()Text string of data to timestamp
gettimestamp()Getting Timestamp from date object

How Unix timestamp is used to generate Julian Day and Calendar




"; require 'bottom-common.php'; ?>