Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Php, Date Format throwing away the '0' in front of single digit date [duplicate]

Tags:

date

php

format

When I do the below code:

date("d/m/y", $date)

It gives me

04/06/15

How can I make it such a way that it will return

4/6/15

What modifications must I do in order to get the desired output? Please advise thanks.

like image 238
NewbieCoder Avatar asked Jun 04 '15 01:06

NewbieCoder


1 Answers

date("j/n/y", $date);

Try this one

like image 167
Alghi Fari Avatar answered Sep 19 '22 16:09

Alghi Fari