[Siddhi] UTC time of a given timezone

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Siddhi] UTC time of a given timezone

Shazni Nazeer

Hi,

I have a requirement to get the UTC time of a given CST time. I can do by adding 6 or 5 hours based on daylight savings.

I have a Siddhi query with a select as below.

time:dateAdd(str:concat(time:dateFormat(time:dateSub(SchApptDateTime, 2, 'day'), "yyyy-MM-dd")," 09:01:00.000"), 6, 'hour')  as ScheduledDateTimeUtc

As you can see I have added 6 hours manually. Is there a way to get the UTC time of a given time based on given time-zone in Sidhdhi?

If not is there an alternative way to get this worked?

regards
--

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [Siddhi] UTC time of a given timezone

Vanjikumaran Sivajothy
AFAIK siddhi does not have a timezone [1].
but cant you write a custom func? [2]



On Tue, Jun 19, 2018 at 2:28 PM, Shazni Nazeer <[hidden email]> wrote:

Hi,

I have a requirement to get the UTC time of a given CST time. I can do by adding 6 or 5 hours based on daylight savings.

I have a Siddhi query with a select as below.

time:dateAdd(str:concat(time:dateFormat(time:dateSub(SchApptDateTime, 2, 'day'), "yyyy-MM-dd")," 09:01:00.000"), 6, 'hour')  as ScheduledDateTimeUtc

As you can see I have added 6 hours manually. Is there a way to get the UTC time of a given time based on given time-zone in Sidhdhi?

If not is there an alternative way to get this worked?

regards
--



--
Vanjikumaran Sivajothy
Lead Solutions Engineer - WSO2 Inc. 
Committer and PMC member - Apache Synapse.

This communication may contain privileged or other confidential information and is intended exclusively for the addressee/s. If you are not the intended recipient/s, or believe that you may have received this communication in error, please reply to the sender indicating that fact and delete the copy you received and in addition, you should not print, copy, re-transmit, disseminate, or otherwise use the information contained in this communication. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions


_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [Siddhi] UTC time of a given timezone

Shazni Nazeer
Thanks, Vanji.

Yes. That seems to be the only way to get it done. Will look into that. 

On Tue, Jun 19, 2018 at 4:47 PM Vanjikumaran Sivajothy <[hidden email]> wrote:
AFAIK siddhi does not have a timezone [1].
but cant you write a custom func? [2]



On Tue, Jun 19, 2018 at 2:28 PM, Shazni Nazeer <[hidden email]> wrote:

Hi,

I have a requirement to get the UTC time of a given CST time. I can do by adding 6 or 5 hours based on daylight savings.

I have a Siddhi query with a select as below.

time:dateAdd(str:concat(time:dateFormat(time:dateSub(SchApptDateTime, 2, 'day'), "yyyy-MM-dd")," 09:01:00.000"), 6, 'hour')  as ScheduledDateTimeUtc

As you can see I have added 6 hours manually. Is there a way to get the UTC time of a given time based on given time-zone in Sidhdhi?

If not is there an alternative way to get this worked?

regards
--



--
Vanjikumaran Sivajothy
Lead Solutions Engineer - WSO2 Inc. 
Committer and PMC member - Apache Synapse.

This communication may contain privileged or other confidential information and is intended exclusively for the addressee/s. If you are not the intended recipient/s, or believe that you may have received this communication in error, please reply to the sender indicating that fact and delete the copy you received and in addition, you should not print, copy, re-transmit, disseminate, or otherwise use the information contained in this communication. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions



--

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev