Ejemplo n.º 1
0
  public static String getUTCTimeZoneOffset() {

    Calendar calendar = Calendar.getInstance();

    TimeZone timeZone = TimeZone.getTimeZone(calendar.getTimeZone().getID());
    int offsetInMS = timeZone.getRawOffset();

    return offsetInMS >= 0
        ? "+" + DurationFormatUtils.formatDuration(offsetInMS, "HH:mm")
        : DurationFormatUtils.formatDuration(offsetInMS, "HH:mm");
  }
Ejemplo n.º 2
0
  //    @Scheduled(cron="0 0 19 * * ?") // это 3 по Москве, так как время сервера в EST, таблица
  // соответствия
  // http://www.worldtimebuddy.com/?qm=1&lid=5,703448,524901&h=5&date=2014-12-28&sln=19-20
  public void update() throws IOException {
    long start = System.currentTimeMillis();

    termService.reload();
    updateCacheSearchResult();

    long end = System.currentTimeMillis();
    final String duration = DurationFormatUtils.formatDuration(end - start, "HH:mm:ss");
    eventPublisher.publishEvent(new SimplePushEvent("Кеш обновлён за " + duration));
  }
 @Override
 public String apply(@Nonnull Timestamp timestamp) {
   return DurationFormatUtils.formatDuration(timestamp.elapsedMillis, elapsedTimeFormat);
 }