I am afraid, this would seem duplication of many questions on this same context, but i couldn’t find any answers for me in that.
What i want is a comparison between two UTC’s. One generated in java and one in PHP. I find both UTC (millisecond strings) entirely different.
The real case is an expiry calculation for authorization. I can allow a 3 minute expiry for a token. The token may be coming from any of the Local servers all over the world.
Can any one suggest a soln for this?…
thanks for your help
The PHP timestamp is the number of seconds since the Unix epoch. Java’s libraries use the number of milliseconds since the Unix epoch. So I’d expect the PHP value to be one thousandth of the Java value.
But yes, it’s the same epoch – both UTC, both midnight on January 1st 1970, in the ISO calendar. If the servers agree on time to a reasonable extent, you should be fine. However, 3 minutes is a relatively small window – how confident are you that all the machines involved are syncing with a network time server reasonably frequently?