How to get current date in codeigniter

user2248165 picture user2248165 · Apr 5, 2013 · Viewed 83k times · Source

How to get current date in codeigniter in YY-mm-dd format. I wants to get current date in YY-mm-dd frmat and put this value into input text box

Answer

Edwin Alex picture Edwin Alex · Apr 5, 2013

You can use the PHP date function.

date('Y-m-d');

Up to my knowledge, there is no separate date function in codeigniter.

EDIT :

But if you want date in this format 13-04-05 [ yy-mm-dd ], Try this

date('y-m-d');

For more date formats, check this link PHP Date Formats