使用PHP或MySQL将AM/PM时间转换为24小时格式?
问题描述:
我有一段时间,例如:6:00 AM,7:30 PM等.它也可以轻松更改为6:00:00 AM,7:30:00 PM等.
I have a string of time such as: 6:00 AM, 7:30 PM, etc. It can easily be changed to 6:00:00 AM, 7:30:00 PM, etc as well.
我正在寻找一种方法来将此时间快速转换为24小时格式,例如7:30 PM = 19:30:00.
I'm looking for a way to quickly convert this time into a 24 hour format, e.g 7:30 PM = 19:30:00.
是否有具有此功能的PHP或MySQL函数,还是我必须自行设计?
Is there any PHP or MySQL function which has this capability, or do I have to devise my own?