本文整理了Java中hudson.Util.getPastTimeString()
方法的一些代码示例,展示了Util.getPastTimeString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getPastTimeString()
方法的具体详情如下:
包路径:hudson.Util
类名称:Util
方法名:getPastTimeString
[英]Get a human readable string representing strings like "xxx days ago", which should be used to point to the occurrence of an event in the past.
[中]获取一个人类可读的字符串,表示“xxx days ago”之类的字符串,该字符串应用于指向过去发生的事件。
代码示例来源:origin: jenkinsci/jenkins
/**
* Gets the string that says how long since this build has scheduled.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public @Nonnull String getTimestampString() {
long duration = System.currentTimeMillis()-timestamp.getTime();
return Util.getPastTimeString(duration);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Gets the string that says how long since this build has started.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public @Nonnull String getTimestampString() {
long duration = new GregorianCalendar().getTimeInMillis()-timestamp;
return Util.getPastTimeString(duration);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Gets the string that says how long since this build has started.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public String getTimestampString() {
return Util.getPastTimeString(getElapsedTime());
}
代码示例来源:origin: jenkinsci/jenkins
public String getTimestampString() {
if (record==null)
return Messages.AbstractNodeMonitorDescriptor_NoDataYet();
// return Messages.AbstractNodeMonitorDescriptor_DataObtainedSometimeAgo(
// Util.getTimeSpanString(System.currentTimeMillis()-record.timestamp));
return Util.getPastTimeString(System.currentTimeMillis()-record.timestamp);
}
代码示例来源:origin: jenkinsci/jenkins
/**
* Gets the string representing how long ago the data was obtained.
* Will be the newest of all {@link UpdateSite}s.
*/
public String getLastUpdatedString() {
long newestTs = 0;
for (UpdateSite s : sites) {
if (s.getDataTimestamp()>newestTs) {
newestTs = s.getDataTimestamp();
}
}
if (newestTs == 0) {
return Messages.UpdateCenter_n_a();
}
return Util.getPastTimeString(System.currentTimeMillis()-newestTs);
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Gets the string that says how long since this build has scheduled.
*
* @return string like "3 minutes" "1 day" etc.
*/
public String getTimestampString() {
long duration = System.currentTimeMillis() - timestamp.getTime();
return Util.getPastTimeString(duration);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Gets the string that says how long since this build has started.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public String getTimestampString() {
long duration = new GregorianCalendar().getTimeInMillis()-timestamp;
return Util.getPastTimeString(duration);
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Gets the string that says how long since this build has started.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public String getTimestampString() {
long duration = new GregorianCalendar().getTimeInMillis()-timestamp;
return Util.getPastTimeString(duration);
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Gets the string that says how long since this build has scheduled.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public String getTimestampString() {
long duration = System.currentTimeMillis()-timestamp.getTime();
return Util.getPastTimeString(duration);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Gets the string that says how long since this build has scheduled.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public String getTimestampString() {
long duration = System.currentTimeMillis()-timestamp.getTime();
return Util.getPastTimeString(duration);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Gets the string that says how long since this build has started.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public @Nonnull String getTimestampString() {
long duration = new GregorianCalendar().getTimeInMillis()-timestamp;
return Util.getPastTimeString(duration);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Gets the string that says how long since this build has scheduled.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public @Nonnull String getTimestampString() {
long duration = System.currentTimeMillis()-timestamp.getTime();
return Util.getPastTimeString(duration);
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
/**
* Gets the string that says how long since this build has started.
*
* @return string like "3 minutes" "1 day" etc.
*/
public String getTimestampString() {
return Util.getPastTimeString(getElapsedTime());
}
代码示例来源:origin: org.jenkins-ci.plugins/cloudbees-folder
/**
* Gets the string that says how long since this build has started.
*
* @return string like "3 minutes" "1 day" etc.
*/
@Nonnull
public String getTimestampString() {
long duration = new GregorianCalendar().getTimeInMillis() - computation.getTimestamp().getTimeInMillis();
return Util.getPastTimeString(duration);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Gets the string that says how long since this build has started.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public String getTimestampString() {
return Util.getPastTimeString(getElapsedTime());
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Gets the string that says how long since this build has started.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public String getTimestampString() {
return Util.getPastTimeString(getElapsedTime());
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Gets the string that says how long since this build has started.
*
* @return
* string like "3 minutes" "1 day" etc.
*/
public String getTimestampString() {
return Util.getPastTimeString(getElapsedTime());
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
public String getTimestampString() {
if (record==null)
return Messages.AbstractNodeMonitorDescriptor_NoDataYet();
// return Messages.AbstractNodeMonitorDescriptor_DataObtainedSometimeAgo(
// Util.getTimeSpanString(System.currentTimeMillis()-record.timestamp));
return Util.getPastTimeString(System.currentTimeMillis()-record.timestamp);
}
代码示例来源:origin: jenkinsci/cloudbees-folder-plugin
/**
* Gets the string that says how long since this build has started.
*
* @return string like "3 minutes" "1 day" etc.
*/
@Nonnull
public String getTimestampString() {
long duration = new GregorianCalendar().getTimeInMillis() - computation.getTimestamp().getTimeInMillis();
return Util.getPastTimeString(duration);
}
代码示例来源:origin: jenkinsci/docker-plugin
/** How long ago this was disabled by the system, e.g. "3 min 0 sec". */
public String getWhenDisabledBySystemString() {
if (!getDisabledBySystem()) {
return "";
}
final long now = readTimeNowInNanoseconds();
final long howLongAgoInNanoseconds = now - nanotimeWhenDisabledBySystem;
final long howLongAgoInMilliseconds = TimeUnit.NANOSECONDS.toMillis(howLongAgoInNanoseconds);
return Util.getPastTimeString(howLongAgoInMilliseconds);
}
内容来源于网络,如有侵权,请联系作者删除!