如何在PHP中将float/double值转换为时间戳
问题描述:
你好!
我想将float/double integer 值转换为PHP中的时间戳.
Hello!
I want to convert a float/double integer value to a time stamp in PHP.
0.555 = 1:19:12 PM
// in Microsoft excel we use =TimeValue(0.555)
// it return value: 1:19:12 PM
感谢您的关注!
Thanks for your interest!
答
secondsInDay = 86400 #时间 as 浮点数必须大于或等于零 小于或等于1.
secondsInDay = 86400 # Time as a float must greater or equal to zero and less or equal to one.
dayAsFloat = 0.555 #确定秒数
dayAsFloat = 0.555 # Determine the number of seconds