title: JWT setExpiration for servers time zone Android
body: <p>I'm trying to set up a short expiration time for my JWT web token.  Problem I'm running into is if the client is in a different time zone the server (EST). Currently the working code is as follows.</p>
  
  <pre><code>Map&lt;String, Object&gt; header = new HashMap&lt;&gt;();
  header.put("typ", Header.JWT_TYPE);
  long now = Instant.now().getMillis();
  String compactJws = Jwts.builder()
          .setHeader(header)
          .claim("email", email)
          .claim("password", password)
          .claim("reg_id", reg_id)
          .claim("deviceId", deviceId)
          .claim("gsf", returnGSF())
          .claim("imei", returnIMEI())
          .claim("serial", Build.SERIAL)
          .claim("version", String.valueOf(version))
          .claim("language", language)
          .setIssuedAt(new Date(now))
          .setExpiration(new Date(now + 60000))
          .signWith(SignatureAlgorithm.HS256, settings.getString("keychain", "password"))
          .compact();
  </code></pre>
  
  <p>Sixty Seconds is plenty of leeway. I'm pulling my hair out with all the different Date/Format object variants. How to get the date object for US eastern time regardless of the devices location?</p>