向now()函数添加6个小时 [英] Add 6 hours to now() function
本文介绍了向now()函数添加6个小时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不知道这是否可能. 我已经研究了,找不到任何东西. 我想在值上加上6小时now()将返回. 目前,它以数据库中的日期时间格式返回.
I dont know if this is possible. I have researched it and cant find anything. I want to add 6 hours onto the value now() will return. At the moment it comes back in a datetime format in the database.
还有另一个功能可以将当前时间增加6个小时吗? 谢谢
Is there another function where i can add 6 hours onto the current time? Thankyou
推荐答案
使用NOW() + INTERVAL 6 HOUR
.例如:
SELECT NOW(), NOW() + INTERVAL 6 HOUR
结果:
'2010-07-16 21:25:17', '2010-07-17 03:25:17'
这篇关于向now()函数添加6个小时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文