Re: How to verify the current date?

From: Dr John Stockton (spam_at_merlyn.demon.co.uk)
Date: 10/19/04


Date: Tue, 19 Oct 2004 12:29:24 +0100

JRS: In article <vpa4n0pm5e54ssk0b2teh74jf32fn18pad@4ax.com>, dated
Sun, 17 Oct 2004 10:30:11, seen in news:alt.comp.lang.borland-delphi,
Justus J. <JustEnMarjolein@SKIPTHIS.Chello.nl> posted :
>For a simple shareware check, I would like to add a function to my app
>to verify the current date. Say, the software is allowed to run until
>november 1st, 2004 (hard-coded date limitation), how can i detect
>someone has been messing with the system date/time to bypass this
>check?
>
>I assume unfair users will change the system date/time to prevent the
>shareware nagsscreens from appearing, so I was thinking of looking for
>the newest file in the Windows directory to detect this behaviour.
>However, sooner or later people will reset their system clock to the
>real date/time, for convience in using other software.
>
>Any other suggestions? It should work on all windows version since
>(including) Win95. I'm using D4.

I've only used Win3 & Win98.

You should, of course, arrange that your software does not fail without
due warning; but there is probably no need for it to fail on a precise
date.

You could use, in addition to the plain current date, the date of
Windows boot, which is more likely to be accurate. I don't recall an
official way to get this (without trusting the present date), but when
booting Windows probably touches or creates some files - for me,
apparently c:\windows\system.ini & c:\windows\sa.dat.

Note - there can be good reasons for having future-dated files.

 

-- 
 © John Stockton, Surrey, UK.  ?@merlyn.demon.co.uk   Delphi 3   Turnpike 4 ©
 <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
 <URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htm> clpdmFAQ;
 <URL:http://www.borland.com/newsgroups/guide.html> news:borland.* Guidelines


Relevant Pages

  • Re: Any experience with "The Last One"?
    ... It's true that since the cost of entry to the shareware market is so ... There is no freeware package on Windows ... Stability is important, a certain amount of stability is indeed a sine ... >>The ones who like to play games would not be too happy with it. ...
    (comp.programming)
  • Re: MOST USEFUL...me confused now
    ... For shareware applications, it seems to me that the single biggest ... Given the overwhelming market size of Windows compared to other ... form of the Cocoa application framework. ... The old MacOS API still exists, sort of, in the form of Carbon. ...
    (comp.programming)
  • Re: timing a program on Windows
    ... >file hack to do this, ... The Windows Server 2003 ... There is a "shareware" beefed up version of the command line prompt ...
    (comp.lang.fortran)
  • How to verify the current date?
    ... For a simple shareware check, I would like to add a function to my app ... to verify the current date. ... I assume unfair users will change the system date/time to prevent the ... the newest file in the Windows directory to detect this behaviour. ...
    (alt.comp.lang.borland-delphi)
  • Re: Editors
    ... > cut and pastes that runs on Windows XP that is not overly expensive? ... The Zeus for Windows programmer's editor has line, ... Zeus is shareware, cost $35-00, and the shareware version runs ...
    (comp.lang.cobol)