Extract Time component from DateTime field using PHP
I'm trying to extract the Time from a DateTime field, but when I do so I always get 7:00 PM or 19:00 depending on the format I choose and I can't figure out why.
So, strtotime() recognizes the Time properly, but when I add in the date("H:i:s"...) aspect it errs for some reason. Could someone explain why and what I am doing wrong.
Thank you!
Update:
I kept playing, researching and I have managed to get it to work by doing
but as a novice PHP programmer I'd still like to understand and learn why what I was doing previous wasn't working and if this new code is truly a good solution.