[RESOLVED] [2003] Getting the right Date
In the program im working on, it has a time trial version. Right now I have the program pulling the system date into a variable and checking it with a date file it creates when it is first used.
The only problem with this is all the user would have to do when the time trial ran out is set the date on the computer back. Is there a way to pull a date into a variable that can not be changed by the user?
Re: [2003] Getting the right Date
You could get the date from a time server on the Web, as long as you don't mind enforcing an Internet connection every time your app is run.
The only other way to cope with this is to record the time each time the app exits, then compare the current time to that when it starts up. It doesn't guarantee that the user won't turn their clock back but it does guarantee that it always goes forward for each run so the time will eventually run out. The user could always just increment the time by a few seconds each time they run the app but doing that would be a real pain so someone would have to be very determined to bother.
The other issue is where you store this information so the user can't edit or delete it.
Re: [2003] Getting the right Date
Okay, so how would I get the date off a date and time server?
BTW sorry if you guys are tired of seeing me post questions. Still learning ;-D
Re: [2003] Getting the right Date
Never done it myself. I think it's a specific protocol but I'm not really sure.
Re: [2003] Getting the right Date
ok thanks. Ill figure somthing out. To tell the truth I dont really like the idea of
enforcing a connection everytime the program is run. Thanks
Re: [2003] Getting the right Date
Quote:
Originally Posted by jmcilhinney
Never done it myself. I think it's a specific protocol but I'm not really sure.
I'm not sure but the Network Time Protocol, NTP, could be whats needed here.
http://support.ntp.org/bin/view/Serv..._A_Time_Server