views:

61

answers:

3

I have a database, which is a part of a Library Information system. It keeps track of the books borrowed by customers, keeping the due dates and automating the notification of accountability of customers, if a customer returned a book beyond their due date.

Now, I am using MySQL for the DBMS. What I know is that MySQL's time is dependent on the System (computer's) time. When checking if a borrowed book has already passed it due date, I would compare the current System time with the due date value associated to the borrowed book. Yeah, the database server will actually be running on a PC running winXP.

My problem is, when the system time get changed, integrity of the data and checking of accountability gets compromised. Is there a way to work around this? Is there a sort of 'independent time' that I could use? English is my second language so I really hope that you understand me. Thanks a lot!

NOTE: Yeah, I'm afraid the application does not have a connection to the Internet.

A: 

I would configure an authoritative time server in windows XP. Here is a step by step process.

fergNab
+3  A: 

I think you're trying to program around a problem your application shouldn't worry about. Your app gets time from the computer, you need to be able to rely upon that for accuracy. If the time gets changed, then the time was wrong, so what does that mean for old data? How long was it wrong? It's really not something you can solve programmatically.

A better solution is to make sure the time isn't wrong. Use windows time to sync against a time server to ensure accuracy.

Sam
+1  A: 

If your PC is running within a Windows domain service, you could also choose to have your computer clock constantly synchronize its time with your domain server using the Windows Time Service.

If your PC has internet access, it can actually set its time against US National Institute of Standards Technology time service. Instructions and overview of how to use it can be found at the NIST Internet Time website.

Jon Limjap
I actually have thought of this, I just don't know how to proceed. Gonna check the link, tnx! But the problem I think is the application does not have access to the Internet. It will be deployed in the school's Intranet
ultrajohn