Plan, execute, measure and optimize customer experiences

DS2 Example Code - Datetime UTC

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

DS2 Example Code - Datetime UTC

Hi all,

 

i'm using RTDM 6.4, I need to create a new DATE variable to write the correct sysdate (Timezone: Europe/Rome) on a staging table. I must write it in a TIMESTAMP field mapping the related insert viariable of an insert data process. I tried to use the "Today's Date and Time" Out of the Box variable but i've seen that it writes always the UTC datetime. I also tried to use the following conversion functions in the calculated variable editor but the date written on DB is always in UTC:

  1. "GETDATEINTIMEZONE(<<DateAndTime.today>>,'Europe/Rome')"
  2. TODAY('Europe/Rome')

Any suggestions about the calculation of a new variable, even in DS2 code, to write the correct italian sysdate also respect the change from solar to legal time.

 

Thank you,

Alessandro


Accepted Solutions
Solution
‎07-21-2017 06:48 AM
SAS Employee
Posts: 76

Re: DS2 Example Code - Datetime UTC

Have you applied the hotfix and configuration options from this SAS Note? You shouldn't need a DS2 process - if all your dates are in CET, there won't be any conversion needed once that's in place and set as your default TZ. If you have dates from other TZ's, then the calculated item functions you mentioned would be appropriate to convert it to CET as the input variable to a data process (which will now, per this fix, write it in CET).

View solution in original post


All Replies
SAS Employee
Posts: 76

Re: DS2 Example Code - Datetime UTC

Alessandro -

Can you please clarify if this is something you're doing via DS2 or via a data insert process?

Steve
New Contributor
Posts: 4

Re: DS2 Example Code - Datetime UTC

Hi Shill, thank you for the reply.

 

I'm doing it via a data insert process, mapping a date variable of my table with the "Today's Date and Time" preconfigured SAS variable.

 


Data e ora odierna.PNG
New Contributor
Posts: 4

Re: DS2 Example Code - Datetime UTC

 

Just to explain better,

 

I would also like to know if there is a way, building a DS2 process, to create a date variable to be mapped in the data insert process. I need this date variable to have the correct italian time at every runtime( in DST and standard time).

 

Thank you,

 

Alessandro

 

Solution
‎07-21-2017 06:48 AM
SAS Employee
Posts: 76

Re: DS2 Example Code - Datetime UTC

Have you applied the hotfix and configuration options from this SAS Note? You shouldn't need a DS2 process - if all your dates are in CET, there won't be any conversion needed once that's in place and set as your default TZ. If you have dates from other TZ's, then the calculated item functions you mentioned would be appropriate to convert it to CET as the input variable to a data process (which will now, per this fix, write it in CET).

New Contributor
Posts: 4

Re: DS2 Example Code - Datetime UTC

Thank you so much for this SAS Note! I'll try to install the Hotfix and i'll let you know if it works.

 

Alessandro

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 224 views
  • 1 like
  • 2 in conversation