Timestamp variation on Android devices
<p>My android application is fetching some json data from my server. The json file contains a timestamp value representing the current date which is calculated as follows in PHP:</p>

<pre><code>mktime(0,0,0,date('m'),date('d'),date('Y'))
</code></pre>

<p>ie, I get the unix timestamp at 00:00 Hrs and use it to represent a particular day.</p>

<p>Now, on the android end, the file is parsed and the file timestamp is compared with Java timestamp which is calculated as:</p>

<pre><code>GregorianCalendar aDate = new GregorianCalendar();

GregorianCalendar tDate = new     
GregorianCalendar(aDate.get(Calendar.YEAR),aDate.get(Calendar.MONTH),   
aDate.get(Calendar.DAY_OF_MONTH));

today = (tDate.getTimeInMillis())/1000; 
</code></pre>

<p>As evident, I am trying to calucate the timestamp in Java the same way as I did in PHP. But, strangely, Java takes into account the current time as well. For example, on the Android emulator, the time zone is different(one hour behind than my local time) and I am getting a value for timestamp which is exaclty 3600 sec different than the one calculated in PHP.When I changed the timezone on Android emulator, I had no problem. Is this a Java bug?</p>
