23

I need to schedule several tasks to run, where each needs to run at a specific local time in a different city. For example, one job might need to run at 19:00 New York City, and another needs to run at 08:00 Berlin.

The problem is not only does daylight savings change the UTC time these jobs will run, but different cities adjust their clocks on different days, so the offset between different cities is also constantly changing.

Is there any way to do this in Windows without writing custom scripts? Is there any commercial software package that can handle this?

6
  • 4
    I don't know about third party software, but windows certainly can't handle that. You'd have to work out the time difference for each city and keep up to date with clock changes and adjust your jobs accordingly using windows alone.
    – Simkill
    Mar 12, 2013 at 15:23
  • 1
    Have you seen this discussion stackoverflow.com/questions/48363828 ?
    – Andreas F
    May 26, 2020 at 12:40
  • 1
    Your Windows where you run the task is aware of all TZ changes around the world - this is coming with Windows updates, so that Windows always will know that in a specific TZ daylight has changed. Thus, you just need to use Windows TZ information. You can take it from tzutil or via Powershell. You can use Get-TimeZone and [System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId((Get-Date), 'India Standard Time') to get the correct time in each timezone. Replace 'India Standard Time' with the TZ name you've got previously
    – Hardoman
    Dec 16, 2020 at 16:10
  • In the end I would make a separate PS script that triggers a scheduled task to run according to the PS scripts logic checking the timezones.
    – Hardoman
    Dec 16, 2020 at 16:11
  • Is the start of the task to be triggered from one location or can the trigger happen in the timezone for which it's being tasked?
    – GeekyDaddy
    Feb 5, 2021 at 0:25

6 Answers 6

1

This answer indicates Windows Task Scheduler 'New Trigger' window has a checkbox Synchronize across time zones. When it's checked:

the task is scheduled by UTC only. (All times are still shown as local time, but are stored as UTC.)

So basically create the task, create the trigger, check that box, set the time, BE SURE to subtract the timezone difference for the current location of the machine running the task.

Ex: the task is being setup on a server in California which is PST (Pacific Standard Time) so UTC -8 so we'd add 8hr to California/PST time to get UTC time. Say I want this to run at 6pm in New York which is EST, itself UTC -5 meaning add 5hr to NY/EST to get UTC time; so 6pm would be 11pm UTC. So on the California server task we want it to be 11pm UTC, however the task shows California time, but we know California time is UTC -8 so we simply set task to start at 3pm. This is all providing that checkbox is as that user advises. I can't seem to find official Microsoft documentation on it. It's clearly very confusing

1
  • This sounds like it does the opposite of what I want to do? Schedule tasks according to UTC time and ignore any local offsets, instead of using local time.
    – Chuu
    Mar 15, 2022 at 17:56
0

Have you looked at the windows task scheduler? It can get quite sophisticated on the scheduling.

There is quite a good tutorial in https://www.windowscentral.com/how-create-automated-task-using-task-scheduler-windows-10 . If that link dies, just google for "windows task scheduler".

I've never used it on time zones, but it does look like it has a time zone feature.

-1

You can schedule a variety of different tasks in the Task Scheduler at specific times. To do this, you go to the Task Scheduler >>Action >>Create Task

There you can experiment with the task

The Task Scheduler has many different actions you can experiment with. I don't know if they can run in different time zones, but you can make tasks go off at your local time zone.

-1

I think it's possible without additional apps. You may add clocks to the taskbar's notification area. I know that works on Windows 10. You'll have separate clocks for different time zones. This way you can add reminders and events in the calendar in the time zone you need.

-2

Why would you need the tasks run from one particular host? why not just run the tasks on each system and if needed host the script sources on one network associated volume. when the script finishes it can set whatever notifications and write them back out to the share or Each host already maintains its own time sync for local needs.

It would seem that you are making your work harder by including an unnecessary restriction.

8
  • 1
    We have a server that needs to run a task at 9am in the local time of each of our offices. It would be cool to be able to schedule this in Windows Task Scheduler and have it know when daylight savings time kicks in for each time zone
    – Greg
    Apr 3, 2018 at 2:26
  • 3
    Computers wont know when daylight savings kicks in unless your os issues the time change. Windows certainly does track daylight savings time, provided the time zone configured uses it. Ntp doesn't really associate UTC. NTP is really seconds since the last time reset. If all of your computers are configured for their local time zones then scheduled jobs will occur based on that information. Apr 7, 2018 at 13:17
  • The reason some diverse companies use UTC is so human read logging is in sync between hosts. Computer based logging doesn't need that crutch, but it all depends on the intelligence of the programers and if the consolidated log converts time to some local standard or leaves it as the ntp epoch time and adjusts based on the reference of the viewer. Apr 7, 2018 at 13:24
  • 3
    I think you're missing my point. We have to run a process from a server in our main office multiple times a day. The time lines up with 9am in the local office around the world. We can't run the process in the office, it has to run from a central server, so we can't just change the timezone to the local timezone of each office (it is the local timezone of the main office). It would be cool to have a feature in Windows Task Scheduler to say "Run this at 9am in Chicago".
    – Greg
    Apr 7, 2018 at 19:59
  • 3
    The solution is to setup a job on the remote server that says at 9am local go run this command \\mainserver\jobforremoteserver\job.ps1. Apr 7, 2018 at 20:08
-2

If you are a pro python coder, then you might be able to do what you are aiming for. I am not that good of a python coder so i can't help with the code.

You could maybe run it on a Linux based system, or you can hold virtual operating systems that are for each timezone.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .