如何在开始日期的时间戳中添加秒数,以便获得估计的结束日期?
我有一个带有 start_time 和估计时间(以秒为单位)的任务对象。 start_time 以 MYSQL DATETIME 形式存储在数据库中,估计时间以秒形式存储。我想将秒数添加到 start_time 以获得估计的完成日期。
I have a Task object with a start_time and an estimated time in seconds. The start_time is stored in the database as a MYSQL DATETIME and the estimated time is stored as seconds. I would like to add the seconds to the start_time to get an estimated finish date.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Neville 提供的链接中有很多内容,但稍微切入主题...
我认为使用 DATE_ADD() 更正确,但据我所知,没有性能差异。
There is a lot in the link Neville gave, but cutting slightly to the chase...
I think it is more correct to use DATE_ADD(), but as far as I know there is no performance difference.