Showing date using PHP ‘Strftime’

Saturday, August 23, 2008 13:30
Posted in category PHP tutorials

Showing date using PHP ‘Strftime’

In this post, I am going to teach u a small function, that is to show date using PHP’s built-in function strftime();
Its pretty simple! You have to send a handful of parameters as arguments to the strftime() function. This formats the date in a specified order.
Now, I’ll teach you all how to show date in the following format :
Day, date month, Year.
For Example:

Thursday, 19 June , 2008

Well, as I’ve mentioned above, it is pretty easy.
Just put this PHP code bit wherever you want to display the date

PHP Code:
<?php
$date = strftime(”%A, %d %B, %Y”);
?>

And then, where ever you want to show the date, you put this code :

PHP Code:



<?php
echo $date;
?>

Thats all folks! pretty easy isn’t it? :D

Share/Save/Bookmark

Also read:

You can leave a response, or trackback from your own site.
Tags: php

Leave a Reply


Comments links could be nofollow free.