Skip to content

Always use UTC for build number#1227

Merged
bill-long merged 2 commits into
mainfrom
bilong-buildtime
Sep 15, 2022
Merged

Always use UTC for build number#1227
bill-long merged 2 commits into
mainfrom
bilong-buildtime

Conversation

@bill-long
Copy link
Copy Markdown
Member

We use time-based build numbers which come from the latest commit for the script. The git log command which produces the time shows the time with time zone included.

❯ git log -n 1 --format="%ad" --date=rfc
Wed, 14 Sep 2022 16:10:35 -0500

We then [DateTime]::Parse(), this value. This produces a DateTime with type Local. So then we call DateTime.ToString(). At that point we're producing a string representing the local time. This causes the build number to change dependiing on the time zone of the machine.

With this change we always return a Universal time type, so build numbers are consistent across machines.

@bill-long bill-long requested a review from a team as a code owner September 15, 2022 14:01
@bill-long bill-long merged commit 6c9e8d0 into main Sep 15, 2022
@bill-long bill-long deleted the bilong-buildtime branch September 15, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants