如何在PHP中将float/double值转换为时间戳 [英] How to convert a float/double value to a timestamp in PHP

查看:320
本文介绍了如何在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


这篇关于如何在PHP中将float/double值转换为时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆