5 Replies Latest reply on Dec 24, 2014 4:36 AM by sanjeev.gour

    Can now() function be instructed to produce time in given timezone?

    sanjeev.gour

      Hi-

       

      We use now function to produce current time is some of our queries, it produces the timestamp in the server's current timezone, is there an easy to produce the these timestamps in a given timezone, basically in GMT. For cases where we have the date and time in the Java code, we offset the current server timezone but now() is evaluated inside Teiid, so we don't have that option. Some alternative we see are-

       

      1. Start the JVM with user.timezone=GMT - this works but sets the timezone globally for the JVM.
      2. Have a custom function to produce the in provided timezone

       

      Is there an even simpler way?

       

      Thanks.

      Sanjeev.