如何获取服务器日期 [英] how to get server date

查看:113
本文介绍了如何获取服务器日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获取服务器机器的日期和时间,因为没有人可以更改系统日期和时间.
实际上,当我参加会议服务器的日期和时间时,应该考虑的不是我参加会议的本地计算机.
错误可能是员工更改了系统日期和时间.我想防止它们.

解决方案

我不完全了解您的要求.由于您添加了"SQL2005"标签,因此我想您需要一个查询以获取日期和时间:

  SELECT   CURRENT_TIMESTAMP  


对于SQL Server 2005,您可以使用GETDATE获取数据库服务器上的当前日期和时间.可以在此处找到此功能的详细信息 [ ^ ].

I want to get server machine date and time because nobody can change system date and time.
Actually when I take attendence server date and time should be consider not local machine on which I taking attendence.
Error may be employee change the system date and time.I want prevent them.

解决方案

I do not fully understand what your requirement is. Since you added a "SQL2005" tag, I suppose you need a query for getting the date and time:

SELECT CURRENT_TIMESTAMP


For SQL Server 2005, you get the current date and time on the database server using GETDATE. Details of this function can be found here[^].


这篇关于如何获取服务器日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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