Ahmad.ak Ahmad.ak - 22 days ago 12
Java Question

Does Date class in java calculated or retrieved from user pc?

I want to make trial version for some java applications depend on date..does the date class retrieved from user's pc so he can trick ? Or it's calculated ?

Answer

The date information will indeed come from the system date on the computer it's running on. So if this is a web application with the java code running on the server, that's where it will come from. If it's a standalone java program that you're sharing with others, it will get the date from the user's computer.

There's not really anywhere else it could come from if you think about it: computers don't have a secret, "correct" date and a separate user-modifiable one.

Comments