I have a datetime2 which looks like this:
2012-10-06 22:00:00.0000000
(using php for Microsofts Azure) and I dont know how to format it to something like:
October 06, 2012 at 22:00
Any ideas?
Use strtotime()
:
echo date('F d, Y \a\t H:i', strtotime('2012-10-06 22:00:00.0000000'));
// October 06, 2012 at 22:00
Refer this Date() and strtotime() function to achieve this.
$currentdate="2012-10-06 22:00:00.0000000";
$timestamp=strtotime($currentdate);
$newdate=date("F d Y g:i",$timestamp);
echo $newdate;