$Date
  • 17 Feb 2022
  • 1 Minute to read
  • Dark
    Light
  • PDF

$Date

  • Dark
    Light
  • PDF

Article Summary

This is generated from the built in components of BuildMaster 7.0.0, and may be different than what you have installed (especially if you have extensions); go to [User Icon] -> Documentation within your BuildMaster instance to see exactly what operations are available.

$Date

Returns the current date and time of the local timezone in the specified .NET datetime format string, or ISO 8601 format (yyyy-MM-ddTHH:mm:ss) if no format is specified.

Script usage:

$Date([Format])

Parameters:

NameDescription
FormatAn optional .NET datetime format string.

See also:

Example:

# format strings taken from https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
set $OtterScript = >>
Now: $Date
UTC Now: $DateUtc

Custom: $Date(hh:mm:ss.f)
RFC1123: $Date(r)
Sortable: $Date(s)
Short time: $Date(t)
>>;

set $Result = $Eval($OtterScript);

Log-Information $Result;

Was this article helpful?

What's Next