Running SSIS using DataFactory GETDATE() Issue

JoelP 241 Reputation points
2023-04-19T01:15:51.4966667+00:00

Hi, We have started using datafactory to run our SSIS packages. We are having issue with GETDATE() where it returns UTC instead of the timezone setting of datafactory / SSIS runtime. Am I missing something?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,739 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 31,721 Reputation points Microsoft Employee
    2023-04-19T06:48:07.0566667+00:00

    Hi Joel Prescilla , Thankyou for using Microsoft Q&A platform and thanks for posting your question here. From the description of your query, it seems you are trying to use GETDATE() function in the SSIS package which is being executed in ADF pipeline. However, you want to get the date in your desired timeZone. Please correct me if the understanding is wrong.

    GetDate() Function Returns the current date of the system in UTC time (Universal Time Coordinate) using a DT_DBTIMESTAMP format.

    • If you want to convert the date value to desired timeZone then you can use the following expression in ADF pipeline: @convertTimeZone(utcnow(),'UTC','Time Zone Name') Kindly check the Microsoft Time Zone Index Values here: Microsoft Time Zone Index Values
    • Alternate approach is to use fromUTC() funtion to convert the UTC time to a different timezone . For Example: fromUTC(currentUTC(), 'Asia/Seoul')
    • Alternate approach in SQL Server: Convert values between different time zones Hope it helps. Kindly accept the answer if it's helpful.