Time depends on how?

I have a database that is part of the library information system. It keeps track of books borrowed by customers, complies with deadlines and automates notification of customer accountability if the customer returns the book beyond a specified date.

Now I use MySQL for the DBMS. I know that MySQL time depends on system time. When verifying that the borrowed book has already passed, I would compare the current system time with the date value associated with the borrowed book. Yes, the database server will run on a PC with winXP.

My problem is that when the system time changes, data integrity and liability verification become compromised. Is there any way around this? Is there some kind of "independent time" that I could use? Many thanks!

NOTE. I am afraid that the application does not have an internet connection.

+4
source share
3 answers

I think you are trying to program a problem that your application should not worry about. Your application receives time from the computer, you need to be sure of it. If the time changed, then the time was wrong, so what does this mean for old data? How long was this wrong? This is really not something you can solve programmatically.

The best solution is to make sure that the time is wrong. Use Windows time to synchronize with the time server to ensure accuracy.

+3
source

If your computer is running a Windows domain service, you can also configure the time synchronization of your computer with a domain server using the Windows time service.

If your computer has Internet access, it can actually set its time to the US National Institute of Standards time service. Instructions and an overview of how to use it can be found on the NIST website .

+1
source

I would set up a reputable time server in Windows XP. Here is a step by step.

0
source

Source: https://habr.com/ru/post/1302709/


All Articles