title: Current date/time in Java under Citrix Xenapp 6.5
body: <p>We maintain a legacy Java application which has just recently migrated to the XenApp 6.5 platform.</p>
  
  <p>But when we display the current time it is displaying the server time and not the user's time on the Powered Shared Desktop.</p>
  
  <p>For example, the user is in timezone offset 9.5, but when outputting the timezone it is displayed as 10.</p>
  
  <p>We have tried:</p>
  
  <pre><code>TimeZone.getDefault().getID());
  System.getProperty("user.timezone"));
  </code></pre>
  
  <p>And we are getting the time by:</p>
  
  <pre><code>private final static DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
  private Calendar                intCal;
  
  
  intCal = Calendar.getInstance();
  intCal.setTimeInMillis(System.currentTimeMillis());
  String df = dateFormat.format(intCal.getTime());
  </code></pre>
  
  <p>Is there an offical way to get the user's time?</p>
  
  <p>Also using a VBS it outputs the same:</p>
  
  <pre><code>strComputer = "."
  Set objWMIService = GetObject("winmgmts:" _
      &amp; "{impersonationLevel=impersonate}!\\" &amp; strComputer &amp; "\root\cimv2")
  
  Set colTimeZone = objWMIService.ExecQuery("Select * from Win32_TimeZone")
  
  For Each objTimeZone in colTimeZone
      Wscript.Echo "Offset: "&amp; objTimeZone.Bias / 60
  Next
  </code></pre>