View Full Version : Resolved Which function should I be using to extract the time I want ??
11-07-2010, 12:45 AM
I have a dateTime value like 2010-10-09 18:30:54.
And I want to print it as 6:30:54.
Nothing I've tried is getting me there, and I've worked myself into so many circles that I'm kinda lost.
Please point me in the right direction.
11-07-2010, 01:45 AM
If you have the datetime already, use strtotime, basically doing this
echo date('g:i:s', strtotime($currentDateTime));
11-07-2010, 04:00 AM
Ugh. I didn't even think to go back to square one... Unformat it into a unix timestamp, then reformat the components I need out of it.
Thanks. That helps tremendously.
11-07-2010, 04:17 AM
Yup, sometimes that's what it takes... take the specific format, transform to a universal format, then respecify.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.