MMdd格式的TeamCity当前日期变量 [英] TeamCity Current Date variable in MMdd format

查看:133
本文介绍了MMdd格式的TeamCity当前日期变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在TeamCity中,有一种简单的方法来获取当前日期的MMdd格式的变量(例如0811表示8月8日)吗?

In TeamCity is there an easy way to get a variable for the current date in the format MMdd (eg 0811 for 8-Aug)?

我的google-fu没有打开现有的插件。我考虑编写一个插件,但没有安装jdk,这看起来很耗时。

My google-fu did not turn up an existing plugins. I looked into writing a plugin, but not having a jdk installed, that looks time consuming.

推荐答案

一个老问题,但对于那些正在寻找解决方案的人现在可以使用系统参数。

An old question, but for those looking for a solution now there is a system parameter available.

system.buildStartTime

您需要在config中声明它(直到运行时才可用)才能运行。我将我的值设置为 [自动填充]

You need to declare it in config (it's not available until runtime) in order to run. I set mine to value [Filled Automatically]

您可以猜到,这次设置为构建开始时间,因此对于某些需求可能并不理想。但这简单又可靠。

As you can guess, this time is set to the build start time, so that may not be ideal for some needs. But it's easy and reliable.

这篇关于MMdd格式的TeamCity当前日期变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆