Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Php code get only the current date (system date)

Tags:

date

php

php code

<td><?php print strftime('%c'); ?></td>

This code is giving me the current date with the time .. But i want only the current date of the system... What ll be the code for it ??? Thanks in advance..

like image 434
IT gIrLy GiRl Avatar asked Dec 20 '22 20:12

IT gIrLy GiRl


1 Answers

use this:

<td><?php print strftime('%D'); ?></td> 
 //output will be 02/05/13 for February 5, 2013

OR you can use:

<td><?php print strftime('%F'); ?></td>
//output will be 2013-02-05 for February 5, 2013

For more read tutorial here.

like image 153
Code Lღver Avatar answered Dec 22 '22 10:12

Code Lღver