Add timestamp generator
Can be used for artifacts versioning
Change-Id: I3b80b711740f0c9da7400e91a72caee87c0d5464
diff --git a/src/ci/mcp/Tools.groovy b/src/ci/mcp/Tools.groovy
index 19941b4..fcf1dec 100644
--- a/src/ci/mcp/Tools.groovy
+++ b/src/ci/mcp/Tools.groovy
@@ -63,6 +63,16 @@
}
/**
+ * Generate current timestamp
+ *
+ * @param format Defaults to yyyyMMddHHmmss
+ */
+def getDatetime(format="yyyyMMddHHmmss") {
+ def now = new Date();
+ return now.format(format, TimeZone.getTimeZone('UTC'));
+}
+
+/**
* Get URL to artifact by properties
* Returns String with URL to found artifact or null if nothing
*