SQLite当前的日期和时间 [英] SQLite current date and time

查看:86
本文介绍了SQLite当前的日期和时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以根据数据库文件所在的计算机从sqlite数据库中获取当前日期和时间?

Is it possible to get the current date and time from an sqlite database based on the computer the database file is on?

例如我有4台工作组计算机, sqlite数据库文件存储在PC1上,PC2有一个vb.net应用程序,它指向PC1上的数据库文件。在PC2上我想获得当前的数据库日期和时间,无论PC2的日期和时间是什么。这可能是
。如果没有,我可以获得其他PC的当前日期和时间,无论PC2对sqlite语句有什么设置。 

For example i have 4 Workgroup computers, the sqlite database file is stored on PC1, PC2 has a vb.net application which points to the database file on PC1. On PC2 i want to get the current database date and time regardless of what PC2 date and time is. Is this possible. If not is there a work around where i can get the current date and time of the other PC no matter what settings PC2 has with an sqlite statement. 




推荐答案

SQLite对它所在的机器上的系统时间一无所知,因为没有服务器进程要查询的数据库。 WMI可能是最简单的方法。请参阅以下链接:

SQLite won't know anything about the system time on a machine on which it resides since there is no server process for the database to query. WMI might be easiest way to do it. See the below links:

https://social.msdn.microsoft.com/Forums/vstudio/en-US/86d4eed3-07ed-498c-a6f0-02d64f449848/get-time-在另一台机器上?forum = vbgeneral

https://social.msdn.microsoft.com/Forums/vstudio/en-US/ a1d1af9d-f81f-4e96-8ec2-46b92b23bf25 / get-remote-machines-current-time-in-utc-format?forum = vbgeneral


这篇关于SQLite当前的日期和时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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