Your Open Source

 
Related Posts

How to convert date to timestamp

mktime()  function used to convert the date to timestamp in PHP.
The syntax is :
------------------
  mktime(int hour, int min, int sec, int mon, int day, int year) ;




  • hits 423
  • datetime Jul 01 08 11:27:44
  • author Sekar
  • rating

mktime()
The getTimeStamp(string date ) to convert the date to timestamp. And also convertTime2Date(string timestamp ) function used to convert time to standard date. The code as follows :
<?php

function getTimeStamp($dat){
    $dat = explode("-",$dat);
    return mktime(0,0,0,$dat[1],$dat[0],$dat[2]);

}
function convertTime2Date($time){
      return date("d-m-Y",$time);
}
?>
Rating : 12345
Tags :- PHP

Answers

Ryan
Aug 05 08 01:51:22
Please provide the demo for this so that we can check it out on your site.

Ryan
Aug 05 08 01:49:42
really super man.

Your Name:
Your Answers :
<> is a code tag
Preview
Enter the verification code: