Azure / Azure/Azure-Functions

TimerTrigger with time range is not using UTC

Open
#2,109 4 comments 0 reactions 1 assignee Assigned to @fabiocav View on GitHub
needs-investigation Needs: Attention :wave:
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

I have an issue that seems to suggest that TimerTriggers with time ranges running locally (with `func start`) are ignoring the expected timezone.

This is my code:
```
public static class TestTimer {
[FunctionName("TestTimer")] public static async Task RunAsync([TimerTrigger("*/30 * 19-21 * * *")] TimerInfo myTimer, ILogger log) {
log.LogInformation($"C# Timer trigger function executed at: {DateTime.UtcNow}");

}
}
```
I also added this to `host.json` for additional logging:
```
"logging": {
...
"fileLoggingMode": "always",
"logLevel": {
"Function": "Trace",
"default": "Trace"
}
}
```
Running with `func start` logs this:

![screenshot](https://user-images.githubusercontent.com/135965/143304566-5ad7519f-759b-4a54-9042-39769c32fe10.png)

Highlighted in yellow are UTC times, green localtime and blue is 'expected UTC time'.

As you can see from the timestamps on the far left, the process ran at 19:44 UTC which is within the time rage of 19-21. But the function scheduler ignores this and instead schedules the next 5 function triggers for 19:00 local time.

Note: I have not overridden WEBSITE_TIME_ZONE so TZ should be UTC. And even if I do explicitly set WEBSITE_TIME_ZONE to 'UTC' or 'GMT Standard Time' this still occurrs.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.