SQLite当前的日期和时间 [英] SQLite current date and time
问题描述
是否可以根据数据库文件所在的计算机从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:
这篇关于SQLite当前的日期和时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!