本文整理了Java中org.apache.brooklyn.util.time.Time.makeDateStampString()
方法的一些代码示例,展示了Time.makeDateStampString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Time.makeDateStampString()
方法的具体详情如下:
包路径:org.apache.brooklyn.util.time.Time
类名称:Time
方法名:makeDateStampString
[英]returns the current time in #DATE_FORMAT_STAMP format, suitable for machines to read with only numbers and dashes and quite precise (ms)
[中]以#日期_格式_戳记格式返回当前时间,适用于机器仅用数字和破折号读取,且非常精确(毫秒)
代码示例来源:origin: org.apache.brooklyn/brooklyn-utils-common
/** returns the current time in {@value #DATE_FORMAT_STAMP} format,
* suitable for machines to read with only numbers and dashes and quite precise (ms) */
public static String makeDateStampString() {
return makeDateStampString(System.currentTimeMillis());
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-utils-common
@Override
@Nullable
public String apply(@Nullable Long input) {
if (input == null) return null;
return Time.makeDateStampString(input);
}
};
代码示例来源:origin: org.apache.brooklyn/brooklyn-utils-common
@Test
public void testParseDateToStringWithMillisecond() {
Date d = new Date();
// clear seconds, but add a milli - to ensure not just toString formatting but also seconds computation
d.setTime(d.getTime() - (d.getTime() % 60000) + 1);
assertDatesParseToEqual(d.toString(), Time.makeDateStampString(d.getTime()));
}
代码示例来源:origin: org.apache.brooklyn/brooklyn-core
public ToolAbstractExecScript(Map<String,?> props) {
this.props = props;
this.separator = getOptionalVal(props, PROP_SEPARATOR);
this.out = getOptionalVal(props, PROP_OUT_STREAM);
this.err = getOptionalVal(props, PROP_ERR_STREAM);
this.scriptDir = getOptionalVal(props, PROP_SCRIPT_DIR);
this.runAsRoot = Boolean.TRUE.equals(getOptionalVal(props, PROP_RUN_AS_ROOT));
this.authSudo = Boolean.TRUE.equals(getOptionalVal(props, PROP_AUTH_SUDO));
this.noExtraOutput = Boolean.TRUE.equals(getOptionalVal(props, PROP_NO_EXTRA_OUTPUT));
this.noDeleteAfterExec = Boolean.TRUE.equals(getOptionalVal(props, PROP_NO_DELETE_SCRIPT));
this.password = getOptionalVal(props, PROP_PASSWORD);
this.execTimeout = getOptionalVal(props, PROP_EXEC_TIMEOUT);
String summary = getOptionalVal(props, PROP_SUMMARY);
if (summary!=null) {
summary = Strings.makeValidFilename(summary);
if (summary.length()>30)
summary = summary.substring(0,30);
}
this.scriptNameWithoutExtension = "brooklyn-"+
Time.makeDateStampString()+"-"+Identifiers.makeRandomId(4)+
(Strings.isBlank(summary) ? "" : "-"+summary);
this.scriptPath = Os.mergePathsUnix(scriptDir, scriptNameWithoutExtension+".sh");
}
内容来源于网络,如有侵权,请联系作者删除!