Translate

Thursday 18 September 2014

Display time and date in php

Explaination:

            In this Tutorial to Display time and date in php.While fetching and
            dispalying the time and date ie..in database we'll create the createdon 
            like that some field u created based on when the dates will created we
            want that records so we have to write the coding for that we will use
            strtotime function. 

PHP  Coding:


<?php echo date("j M Y h:i A", strtotime($createdon));?>

date month year time am/pm-->this format it will display
j-->Date,
M-->Month,
Y-->Year,
h:i-->Time,
A-->Year

No comments:

Post a Comment