PHP Timestamp Date Time format Function

Today, We want to share with you PHP Timestamp Date Time format Function .
In this post we will show you PHP Date and Time, hear for How to Convert PHP Timestamp to Date Format with example we will give you demo and example for implement.
In this post, we will learn about PHP Date & Time Function with an example.

PHP Timestamp Date Time format Function

There are the Following The simple About PHP Timestamp Date Time format Function Full Information With Example and source code.

Also Read This πŸ‘‰   Laravel 5/6/7 Carbon date format Example

As I will cover this Post with live Working example to develop PHP Timestamp, so the some major files and Directory structures for this example is following below.

  • index.php

Example of The PHP Timestamp


This is where I will make a simple HTML form and PHP server side source code for our web application. To make the forms simply all souce code copy and write it into your any text editor Like Notepad++, then save file it as index.php.

   $student_reg_date = getdate();
   foreach ( $student_reg_date as $key => $val ){
      print "$key = $val<br />";
   $timedate_format  = "Today's date: ";
   $timedate_format .= $student_reg_date['mday'] . "/";
   $timedate_format .= $student_reg_date['mon'] . "/";
   $timedate_format .= $student_reg_date['year'];
   print $timedate_format;

Simple Print Current Timestamp using PHP

  • d – (01 to 31)display the day of the month
  • m – (01 to 12)display a month
  • Y – (in four digits)display a year
  • l (lowercase ‘L’) – display the day of the week
Also Read This πŸ‘‰   Insert Update Delete Query in SQL - SQL CRUD Query

PHP time() Functions

print time()

$today_timestamp = time();
echo $today_timestamp;

PHP strtotime() Functions

print strtotime()

$today_timestamp = strtotime("now");
echo $today_timestamp;

PHP mktime() Functions

print mktime()

$today_timestamp_by_mktime = mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"));
echo $today_timestamp_by_mktime;

PHP microtime() Functions

print microtime()

$today_timestamp_string = microtime();
echo $today_timestamp_string;
$today_timestamp_float = microtime(TRUE);
echo $today_timestamp_float;

PHP date() Functions

print date()

$today_date = date("U");
echo $today_date;

<!DOCTYPE html>

echo "Pakainfo Date is " . date("Y/m/d") . "<br>";
echo "Pakainfo Date is " . date("Y.m.d") . "<br>";
echo "Pakainfo Date is " . date("Y-m-d") . "<br>";
echo "Pakainfo Date is " . date("l");


PHP date Output

Pakainfo Date is 2018/08/20
Pakainfo Date is 2018.08.20
Pakainfo Date is 2018-08-20
Pakainfo Date is Monday

php-timestamp Example

PHP Date with Time to Timestamp Conversion

$date_with_timestamp = date("d-m-Y",$today_timestamp);
echo "Formatted Your date With timestamp:" . $date_with_timestamp;

Angular 6 CRUD Operations Application Tutorials

Read :

Also Read This πŸ‘‰   PHP Add Days Hours Minutes and Seconds to Datetime


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about PHP Timestamp Date Time format Function.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.