Skip to main content

Hi Team,

 

I am facing an Issue with Time zone timings in multievent log data models.

the issues is we are having a PO created in ASIA and SO in Europe and when we merger both activities then because of time zones the sequence of activities are not in order.

 

Could you please help us if there a way to convert all the timestamps into one single time zone.

 

Thanks,

venkat N

HI @1460051339 ,

 

I would head towards transforming the date to UTC within the data job. In this case we are not using PQL but Vertica SQL.

 

As an example, here I am manipulating the date, adding 4 hours to the Activity 'Vendor Creates Invoices'

image 

Hope it helps

Javier

 


Hi again @1460051339 

 

To covert to UTC, (just tested) you can use the following syntaxy

image 

you have your column date BKPF.BLDAT

 

1- You declare which time zone is the appropriate one, in following there is a list of time zones

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List

 

 "BKPF"."BLDAT" AT TIME ZONE 'Europe/Berlin'

 

2- you convert it to UTC in order to be able to compare different time zones events

 "BKPF"."BLDAT" AT TIME ZONE 'Europe/Berlin' AT TIME ZONE 'UTC'

 

This should work and hope it helps

Javier

 

 

 

 

 


Hi again @1460051339 

 

To covert to UTC, (just tested) you can use the following syntaxy

image 

you have your column date BKPF.BLDAT

 

1- You declare which time zone is the appropriate one, in following there is a list of time zones

https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List

 

 "BKPF"."BLDAT" AT TIME ZONE 'Europe/Berlin'

 

2- you convert it to UTC in order to be able to compare different time zones events

 "BKPF"."BLDAT" AT TIME ZONE 'Europe/Berlin' AT TIME ZONE 'UTC'

 

This should work and hope it helps

Javier

 

 

 

 

 

Thank you so much Javier !

 

May I know will this approach also covers daylight saving time change?

 

In my use case we are having four regions Asia, Europe ,Latam and Noram.

I would like change timezone of all systems to Europe(CET).

 

Please let me know if this helps in change in time of daylight saving.

 

Thanks,

Venkat N


Hi Venkat -

I would propose to introduce two tables in your source system as follow.

 

  1. Timezone table where you've probably two columns region and adjusted hours.
  2. daylight table where you maintain start and end date of day light saving for next 50 years. (should be good enough 😉)

 

Now while generating activity table your condition should be as follow:

If PO/ SO is created between day light

then 1 hour + adjusted hours from Timezone table

else adjusted hours

 

Hope this helps.

 

KR,

Kalpesh


Reply