Reputation: 12335
How would I get the hours from a DATETIME format variable.
Example: 2009-08-17 13:00:00
And I just need to get '13'
Upvotes: 2
Views: 7966
Reputation: 1675
in php,
list($date, $time) = explode(' ', '2009-08-17 13:00:00');
list($hour, $min, $sec) = explode(':', $time);
$hour should contain 13.
Upvotes: 3