dateazure-data-factoryoracle-adf

ADF, utcNow() convert to DateTime


in ADF I have a pipeline parameter that is set to utcNow(). I need to pass this parameter to a stored procedure activity that is expecting a datetime value in a parameter. I am trying to convert the utcNow() parameter to a datetime to use in the stored procedure

In my pipeline parameter I have this:

Name: ExecutionTime DefaultValue: @utc.Now()

In my stored proc activity parameter I have:

Name: ExecutionTime Type: Datetime Value: @convertFromUtc(utcNow(),'yyyy-MM-dd hh:mm:ss)

however I'm getting an error: error in function 'convertFromUtc', the value provided for the date time string @uts.Now() was not valid. The datetime string must match ISO 8601 format.

where am I going wrong here?


Solution

  • By default, Data Factory’s date functions use ISO 8601 format for the return value, for example, 2022-09-30T21:53:00.0000000Z. If we want to get timestamp in a different format, one option is to pass a format specifier which is basically a one-character string like 'o' or 'D'. Please find the list of all format specifiers https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings#table-of-format-specifiers