title: Converting cron expression from one timezone to UTC in java
body: <p>Is there any java library/API which can modify cron expression from one timezone to UTC?</p>
  
  <p>For example:</p>
  
  <p>I need something like this:</p>
  
  <pre><code>newCronExpression = convert (oneCronExpression, fromTimezone, "UTC")
  </code></pre>
  
  <p>Let me give you one example:</p>
  
  <p>My local timezone is IST i.e. <code>GMT+5.30</code>.</p>
  
  <p>Current local time is: <code>11:20 AM</code>.</p>
  
  <p>I want a job to run in 45 min of every hour.</p>
  
  <p>So, my cron expression: <strong>45 * * * *</strong></p>
  
  <p>Hence I am expecting my job to run after 25 min ( as starting time is <code>11:45 AM</code>)</p>
  
  <p>but my job is running as per UTC.</p>
  
  <p>Current time in UTC : <code>05:50 AM</code></p>
  
  <p>As per cron expression 45 * * * , the starting time will be 06:45 AM at GMT.</p>
  
  <p>So, the job will be actually started after 55 min.</p>
  
  <p>Expected : After 25 min</p>
  
  <p>Actual : After 55 min</p>
  
  <p>So, </p>
  
  <blockquote>
    <p>if I am converting my local cron expression 45 * * * to 15 * * * * at
    GMT, then actual waiting period will be same as expected.</p>
    
    <p>The question is how will I convert my local cron expression to GMT for
    all usecase in my java program.</p>
  </blockquote>
  
  <p>If you have better approach, please do let me know.</p>
  
  <p>*I can't schedule it as crontab in unix machine. This has to be handled in Java program.</p>
  
  <p>Thanks in advance.</p>