How to get the real system date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I get the real system date/time if the user fakes the date, for
example by setting the system date back.
 
Hi,

DateTime.Now is the REAL time, real at least for the local computer.

You can check a time server in the internet ; I don't know if any right now
but I bet that a couple of US institutions give this service for free; and
if the returned time is different thatn the local time you change it.

Note that there will always be a little delta from the time the remote
server sent the time until you process it in your app.

You need to P/Invoke SetSystemTime from the win API
 
The date/time is taken from the real-time clock (RTC), if the user fakes the
system date, he effectively fakes the RTC.

Willy.

| How can I get the real system date/time if the user fakes the date, for
| example by setting the system date back.
|
|
| --
| Mike
 
Hello Mike9900,

I thing that using internet time servers like time.nist.gov or time.nist.gov
is more reliable way than rely on time in machine

M> How can I get the real system date/time if the user fakes the date,
M> for example by setting the system date back.
M>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
Mike9900 said:
How can I get the real system date/time if the user fakes the date, for
example by setting the system date back.

You have to get the date and time from another computer that you can accept
as having the correct time. This could be a server, a database server or the
NIST server. As the applications I write connect to a database server it is
a trivial matter to get the date and time of the server via a stored
procedure. If you give more details about the application and what you are
trying to achieve then you might get a better answer .

SP
 
Mike9900 said:
How can I get the real system date/time if the user fakes the date, for
example by setting the system date back.

I just saw your other post asking about storing an expiration date time. I
gather you are trying to offer a trial version of your software and also
eliminate the possibility of uninstall / reinstall to "reset" the trial
period. This issue is a part of the whole software licensing issue. What
about the full blown product and the ability to install multiple times etc.
My suggestion is to look for a commercial product that has the features that
you want. VBox is one such product.

SP
 
Mike9900 said:
How can I get the real system date/time if the user fakes the date, for
example by setting the system date back.

If they have set the system date back, that becomes the new real system
date. It may not be the real date time, but it is as real as you can get on
that machine. So DateTime.Now will always give that value. If you need the
real date, not whatever date/time the user has set on their system, then you
need to query an external server that you trust to always be accurate.
 
Thanks for the reply.

But I meant in the trial version of software the user could fake the date
and the program could run for ever. In MS Software, trial cannot be faked by
changing the system date.
 
Mike9900 said:
How can I get the real system date/time if the user fakes the date, for
example by setting the system date back.

I see from the other posts you are talking about trail version software.
IMO, the only thing you can do is have the software "phone home" when
it starts. The first time it runs you record the date/time and user
key. At each startup you "phone home" to see if the software can still
run. After the trial period, that username/key can no longer be used.

Of course there is the issue of will your users accept your software
"phoning home" every time it starts up? I personally won't use software
like that. It all comes down to what you think your users will put up
with in a trial version.

There really is no way to prevent a determined user from running a trial
version multiple times. For example, if I _really_ wanted to run your
trail version without paying, I could use VMware or one of the other VM
apps to run your software and just keep resetting the virtual machine to
a state before expiration.

Have you thought about offering a reduced functionality version instead
of a timed version? All the cool features that someone will be willing
to pay for go in the full version. You give the users a sample with the
limited functionality version and not worry about trying to only allow
it to run for 30 days or 30 startups.

Jim
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
You roll an 18 in Dex and see if you
don't end up with a girlfriend
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
JimD
Central FL, USA, Earth, Sol
 
Sorry, missed that part. I wonder if they (MS) have a processes running
in the background to keep a running count since installation? What
about just limiting your trial to "uses" so each "day" is a day that
you open the app (although you could technically keep resetting the
clock to the same day and get away with it)?


Russ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top