I have a date in the this format : Aug 18, 2014 15:30:35.246263000
I want to convert this format to timestamp i.e 2014-8-18 15:30:35.
I don't know how timestamp handle milliseconds. I am using PHP and MySql.
Like scragar said, you can't convert exactly your date to a unix timestamp, since the timestamp doesn't support milliseconds. You can however trim the milliseconds and use strtotime, like such:
$time = 'Aug 18, 2014 15:30:35.246263000';
$parts = explode('.', $time);
$timestamp = strtotime($parts[0]);
Good luck!
Here you go
$date = 'Aug 18, 2014 15:30:35.246263000';
echo date('Y-m-d H:i:s',strtotime(substr($date,0,strpos($date,'.'))));
You can do it in single line also
echo date('Y-m-d H:i:s',strtotime(substr('Aug 18, 2014 15:30:35.246263000',0,strpos('Aug 18, 2014 15:30:35.246263000','.'))));
Hope it help you :)