Menu
Home
Recent Posts
Convert date format yyyy-mm-dd to dd-mm-yyyy
6:40 AM
0
Share
Use
strtotime()
and
date()
:
$originalDate
=
"2010-03-21"
;
$newDate
=
date
(
"d-m-Y"
,
strtotime
(
$originalDate
));
(see
strtotime
and
date
docs on the PHP site).
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Development and programming answers
Search articles
Popular Posts
How to get query string values in JavaScript
function getParameterByName ( name ) { name = name . replace ( /[\[]/ , "\\[" ). replace ( /[\]]/ , "\\]" ); ...
How to solve: Parse error: syntax error, unexpected T_XXX
This happens when you have T_XXX token in unexpected place, unbalanced (superfluous) parentheses, use of short tag without activating it in ...
How to solve: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given
First and foremost: This happens when you try to fetch data from the result of mysql_query but the query failed. This is a warning and...
How to: detect a click outside an element with jQuery
Attach a click event to the document body which closes the window. Attach a separate click event to the window which stops propagation to th...
How to: Calculate the difference between 2 dates in PHP
Input: Start Date : 2007 - 03 - 24 End Date : 2009 - 06 - 26 Output: 2 years , 3 months and 2 days Use strtotime() to conve...
No comments:
Post a Comment