Timestamp to Date

Ho do I convert:

2010-12-24 11:39:43


24/12 11:39



This should to the trick:

$newFormat = Date ( 'd/m H:i', StrToTime ( '2010-12-24 11:39:43' ) );

You use StrToTime to convert a string representation of a date to timestamp. You then feed that timestamp to the Date function that takes the format of the date as the first parameter.


$unixtime = strtotime("2010-12-24 11:39:43");

$newFormat = date("d/m H:i", $unixtime);

echo date("d/m H:i", strtotime("2010-12-24 11:39:43"));

$date = DateTime::createFromFormat('Y-m-d G:i:s', 2010-12-24 11:39:43); //You can simply tell DateTime accept your timestamp as is since PHP 5.3

echo $date->format('d/m G:i T'); //Will output what you wanted + Timezone Abbreviation (because of the T) 

Need Your Help

PHP ImageJPEG method but for Java

java php image methods jpeg

I'm looking for a Java solution to this. I need a Java method that behave exactly the same as php IMAGEJPEG method does.

Should I Refactor This Code?

c# asp.net refactoring

I am working on modifying a control on a existing site. All controls from the site inherit form a base class. I have a requirement to hide several links on the master page so I wrote this method ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.