如何获得&保存服务器日期和时间Vb.net,Vb 6.0中的时间 [英] How to get & save Server date & time in Vb.net,Vb 6.0
问题描述
:(((亲爱的先生,
我正在开发一个工资表应用程序,该应用程序维护日期和时间,但是当我保存日期和时间时,它将保存每台客户端计算机的日期和时间.由于任何机构都可以更改客户端计算机系统日期和时间的时间和日期,因此这不是当前方法.我希望系统应保存数据库所在的服务器计算机的日期和时间.
因此,请如何提供示例代码来帮助我.
谢谢你
Debasis Bag
:(( Dear Sir,
I am developing a payroll application which maintain date & time but when I save the date & time which save the date & time of every client machine. which is not currect because any body can change the time and date of client machine''s system date & time. I want system should save date & time of server machine where database is resided.
So how to possible please help me with a sample code.
thanking You
Debasis Bag
推荐答案
因此,请勿发送应用程序中的日期和时间,并让数据库为您执行此步骤例如:
如果要保存每个用户的登录时间,则执行SQL查询,并在查询内部调用数据库中的datetime函数.
So don''t send the date and time from your application and let the database do this step for you Ex:
if you want to save the login time of every user then excute sql query and inside the query call the datetime function in your database
insert into logs ( loginTime ) values ( now() ) ;
确保此语句从数据库到另一个语句都会有所不同
for sure this statement will be different from database to another
这篇关于如何获得&保存服务器日期和时间Vb.net,Vb 6.0中的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!