Table of Contents

Method ToBuildIndex

Namespace
Ubiquity.NET.Versioning
Assembly
Ubiquity.NET.Versioning.dll

ToBuildIndex(DateTime)

Gets a build index based on a time stamp

public static string ToBuildIndex(this DateTime timeStamp)

Parameters

timeStamp DateTime

Time stamp to use to create the build index

Returns

string

Build index as a string. The time stamp is converted to UTC (if not already in UTC form) so that the resulting index is consistent across builds on different machines/locales.

Remarks

Since the resulting build index is based on the number of seconds since midnight and needs to fit in a limited string output. There is a narrow window of 2 seconds where two distinct builds (Local or PR) might generate the same matching build number. However, since this number is normally only used for local builds that's not realistically a problem. (Automated builds usually use the time stamp of the HEAD commit of the repo as the build index)