An Azure service for ingesting, preparing, and transforming data at scale.
Hi Chris J,
it turns out nothing is wrong with ADF’s Blob connector— toTimestamp() is simply failing to parse your string, so it returns NULL. Here’s why and how to fix it:
- Java-style vs .NET-style format strings
- Your pipeline’s
@formatDateTime(..., 'yyyy-MM-dd HH:mm:ss.fff')is using the .NET “fff” specifier. - ADF Data Flow’s
toTimestamp(str, format)uses Java’s SimpleDateFormat under the covers, so it expects “SSS” for milliseconds, not “fff”.
- Your pipeline’s
- Make sure your string and pattern line up exactly
- For example, if your string is 2026-04-24 13:18:34.698 then parse it with: toTimestamp(
)$StartTimeString, 'yyyy-MM-dd HH:mm:ss.SSS' - If you have more than three fractional digits you’ll need to trim them down (ADF only supports up to 3ms digits). You can use the substring trick from the docs:
toTimestamp( substring($StartTimeString, 0, 23), 'yyyy-MM-dd HH:mm:ss.SSS' )
- For example, if your string is 2026-04-24 13:18:34.698 then parse it with: toTimestamp(
- A slightly simpler alternative: ISO-8601 + default parser
- If you emit your pipeline date as ISO-8601 (e.g.
2026-04-24T13:18:34.698Z), then you can often calltoTimestamp($StartTimeString)with no format and ADF will pick up the default"yyyy-[M]M-[d]d hh:mm:ss[.f...]"pattern.
- If you emit your pipeline date as ISO-8601 (e.g.
Putting it all together:
• In your pipeline, change the format string to match Java’s pattern (or just output ISO-8601).
• In your Data Flow, treat the param as a string, then in the Source → Filter by last modified (Start time) box put:
toTimestamp(
substring($StartTime, 0, 23),
'yyyy-MM-dd HH:mm:ss.SSS'
)
That will give you a real timestamp you can feed into the blob filter.
Reference Docs
- Data flow expressions & toTimestamp() usage (Java patterns): https://learn.microsoft.com/azure/data-factory/data-flow-expression-functions#toTimestamp
- Milliseconds truncation workaround (substring +
.SSS): https://learn.microsoft.com/azure/data-factory/dataflow-troubleshoot-guide#resolve-truncated-milliseconds-in-azure-data-factory-dataflow-datetime-processing - Blob source “Filter by last modified” property: https://learn.microsoft.com/azure/data-factory/connector-azure-blob-storage#mapping-data-flow-properties
Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.