azure-pipelines-variable-tasks
azure-pipelines-variable-tasks copied to clipboard
Set variable to current date
Would be nice to be able to set a variable to the current date (with a specified date format). I don't believe this is possible today (without adding a custom script task to do it)
PR welcome :)
Bit outdated now but you can use the pipeline.startTime variable.
Example where I formatted it too
variables:
timestamp: $[format('{0:yyyyMMddHHmmss}', pipeline.startTime)]
but pipeline.startTime changes per stage of the pipeline