title: Compare java Date to sql TIMESTAMP in the same timezone
body: <p>I need to compare between <code>userCurrentDate</code> to a list of options.</p>
  
  <p>The options is a table in the database that contain time attribute (definition: TIMESTAMP(6) WITH TIME ZONE. in oracle). Each option have his time zone. </p>
  
  <p>The <code>userCurrentDate</code> (definition Date. in java)  is a parameter that hold the user time and date with offset. The user can be from all over the world, so each user is in different time zone.</p>
  
  <p>I need to compare between the user current <strong>date</strong>  to the options <strong>date</strong>.
  So i need to get this 2 parameters in the same time zone.</p>
  
  <p>How can i get this 2 parameters in the same time zone, in <strong>SQL</strong>?</p>
  
  <p>I tried to get them in GMT, so i can get them in the same base, like this:</p>
  
  <pre><code>trunc(SYS_EXTRACT_UTC(o.time)) = trunc(sysdate)  
  </code></pre>
  
  <p>But its not a good solution. </p>
  
  <p>So, i need to get them in the same timezone. how can i get that in an SQL command (or other solution)?</p>