简体   繁体   English

仅从时间戳记值获取时间值

[英]Get time value only from timestamp values

I am fetching dateLocal variable as "2013-04-18T12:25:00.000" How can I retrieve only 12:25:00.000 in this ? 我正在将dateLocal变量提取为“ 2013-04-18T12:25:00.000”,如何在其中仅检索12:25:00.000呢?

I am calling this value in below code 我在下面的代码中调用此值

echo $flightstatus->arrivalDate->dateLocal,"<br>";

You can use date and strtotime function to achieve this 您可以使用datestrtotime函数来实现此目的

echo date('H:i:s',strtotime($flightstatus->arrivalDate->dateLocal));

this will output 这将输出

12:25:00

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM