Setting build worker Time Zone
Hi.
In my build script I rely on time stamps and would like to change the time zone of the build worker.
In the init script I added
tzutil /s "Mountain Standard Time"
$env:TimestampBuildVersion = (Get-Date).ToString('yy.M.d.HHmm');
but it seemed to have no effect. Am I doing something wrong?
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac

Support Staff 1 Posted by Feodor Fitsner on 30 Jun, 2015 02:31 AM
Well, this worked before: http://help.appveyor.com/discussions/questions/892-change-timezone-...
Try maybe calling it as "cmd", not "ps".
2 Posted by lukasz.stanczyk on 30 Jun, 2015 04:05 AM
I do pretty much the same thing -
here is part of my YML file:
init:
- cmd: tzutil /s "Mountain Standard Time"
- ps: $env:TimestampBuildVersion = (Get-Date).ToString('yy.M.d.HHmm');
it still did not work for me.
Support Staff 3 Posted by Feodor Fitsner on 30 Jun, 2015 04:17 AM
I've played with that a little bit. Seems like PowerShell stores time zone in the session.
For example this works:
If you restart PowerShell console
Get-Dateworks too.Support Staff 4 Posted by Feodor Fitsner on 30 Jun, 2015 04:21 AM
Found this: http://stackoverflow.com/questions/29161929/powershell-showing-old-...
5 Posted by lukasz.stanczyk on 30 Jun, 2015 04:38 AM
OK so in this case is the Init script and build script in the same powershell session?
Support Staff 6 Posted by Feodor Fitsner on 30 Jun, 2015 04:47 AM
Yep. Everything is one PowerShell session.
If everything you need is getting current date time in some local zone you can do just:
7 Posted by lukasz.stanczyk on 30 Jun, 2015 06:03 PM
That is the workaround I used. Thank you.
best regards,
*Lukasz Stanczyk*
*CTO, co-owner*
email: [email blocked]
office: +1 (605) 721-9893
cell: +1 (605) 269-1177
* PIXEL PINES*, LLC
625 1/2 Main Street, Suite #2
Rapid City, SD 57701
lukasz.stanczyk closed this discussion on 18 Aug, 2015 05:40 PM.