0

I have a runbook that I run in DevOps to set up a schedule in Azure using Register-AzAutomationScheduledRunbook

I cannot seem to get it to set to UK time. The VM is in Western Europe.

However when I use:

TimeZone = "GMT Standard Time"

The times I put for my schedule get an hour added onto them.

Does anyone know how to get the schedule to set to UK time please?

Thanks

abinitio
  • 609
  • 6
  • 20

1 Answers1

1

The United Kingdom uses Greenwich Mean Time or Western European Time (UTC) and British Summer Time or Western European Summer Time (UTC+01:00).

To change the current time zone from PowerShell, run the command

$TimeZone = "W. Europe Standard Time"
New-AzAutomationSchedule -AutomationAccountName krishtoautomationdemo -Name "MySchedule" -StartTime "23:00" -OneTime -ResourceGroupName HariMT -TimeZone $TimeZone

Where $TimeZone variable contains the Id of the TimeZone.

Output:

enter image description here

Note: In the Local or Azure PowerShell, Run this command to get Ids of each time zone.

Get-TimeZone -ListAvailable

That Id is used to set timezone for creating the resources in Cloud through PowerShell. enter image description here

UK is the country in Europe so it uses GMT or W. Europe time (UTC +01:00).

  • Great 0 thank you. And will this take account for the British daylight savings changes when the happen? – abinitio Oct 07 '21 at 10:55
  • 1
    Hi @abinitio, the script what i have mentioned, that will even effect the daylight saving changes as well –  Oct 07 '21 at 11:48
  • Hi @HariKrishnaRajoli-MT - this doesn't seem to work. When I use W. European Time in my pipeline it comes up as "Central European Time" and seems to have two hours added to the time I input. Which I find very confusing. – abinitio Oct 12 '21 at 14:55
  • Hi @abinitio, W. European Time and Central European Time has different Ids and [time gap](https://i.imgur.com/MLdVFXT.png). Central Eu. Time has 1 hour ahead than the W. European Time and 2 hours ahead than the GMT. Please check once the Id you used in the Timezone. –  Oct 12 '21 at 16:09
  • @abinitio, try checking the id you provided once and if still getting the same, could you provide me any screenshot –  Oct 12 '21 at 16:11