Unix & Readable Time - PHP Tool

The current unix timestamp and the human readable equlivant.

445 views

Edited: 2023-10-28 09:22

The input (unix time or English date string):

The output (Y-m-d H:i:s, unix, and time zone):

Today's unix timestamp is initially shown, as well as the human-readable equivalent. You can either type a readable date or a unix stamp and hit the "convert" button to view its equivalent.

cURL:

curl -d "datetime=today + 1 day" https://beamtic.com/api/time/date
curl -d "json=true" https://beamtic.com/api/time/unix

How can this tool be used

You can use this tool to convert an English date string to a unix timestamp and Vice versa. The tool relies on PHP's built-in date and strtotime functions.

Some pretty interesting things are possible when converting strings to unix time. E.g. Try writing today + 1 day and observe the output.

Time table

The following table shows how many seconds there is over different time spans. Note that values are only approximates. The actual number of seconds in given periods may very due to leap seconds; in addition, the number of days in a single month also varies. If you need precision, then you should not rely on UNIX timestamps.

1 day 86400
1 weak 604800
1 month 2629746
1 year 31556952

How the timestamp tool works

This tool works by contacting a server-side PHP script by sending an AJAX GET request using the http client; the server then creates the timestamp using PHP and sends it back to your browser.

Tell us what you think:

  1. Tool to generate a md5 hash from a string.
  2. Tool to view your Browsers current user agent string.

More in: Web Tools