Examples of DateTime


Examples of org.joda.time.DateTime

    _progressInformationPanel.addUserLog("Job begin (" + now + ")");
  }

  @Override
  public void jobSuccess(AnalysisJob job) {
    String now = new DateTime().toString(DateTimeFormat.fullTime());
    _progressInformationPanel.addUserLog("Job success (" + now + ")");
    _progressInformationPanel.onSuccess();
  }
View Full Code Here

Examples of org.joda.time.DateTime

    _progressInformationPanel.updateProgress(table, currentRow);
  }

  @Override
  public void rowProcessingSuccess(AnalysisJob job, final Table table) {
    String now = new DateTime().toString(DateTimeFormat.fullTime());
    _progressInformationPanel.addUserLog("Row processing for " + table.getQualifiedLabel() + " finished (" + now
        + "). Generating results ...");
  }
View Full Code Here

Examples of org.modeshape.jcr.api.value.DateTime

        Matcher matcher = RepositoryConfiguration.INITIAL_TIME_PATTERN.matcher(initialTimeExpression);
        if (matcher.matches()) {
            int hours = Integer.decode(matcher.group(1));
            int mins = Integer.decode(matcher.group(2));
            DateTimeFactory factory = runningState().context().getValueFactories().getDateFactory();
            DateTime now = factory.create();
            DateTime initialTime = factory.create(now.getYear(), now.getMonthOfYear(), now.getDayOfMonth(), hours, mins, 0, 0);
            long delay = initialTime.getMilliseconds() - System.currentTimeMillis();
            if (delay <= 0L) {
                initialTime = initialTime.plusDays(1);
                delay = initialTime.getMilliseconds() - System.currentTimeMillis();
            }
            if (delay < 10000L) delay += 10000L; // at least 10 second delay to let repository finish starting ...
            assert delay >= 0;
            return delay;
        }
View Full Code Here

Examples of org.mule.el.datetime.DateTime

        if (numParams == 1)
        {
            Object dateParam = params[0];
            if (dateParam instanceof Date)
            {
                return new DateTime((Date) dateParam);
            }
            else if (dateParam instanceof Calendar)
            {
                return new DateTime((Calendar) dateParam);
            }
            else if (dateParam instanceof XMLGregorianCalendar)
            {
                return new DateTime((XMLGregorianCalendar) dateParam);
            }
            else
            {
                try
                {
                    return new DateTime(dateParam.toString());
                }
                catch (RuntimeException e)
                {
                    throw new ExpressionRuntimeException(
                        CoreMessages.createStaticMessage("Unable to parse string as a ISO-8601 date"), e);
                }
            }
        }
        else
        {
            try
            {
                return new DateTime((String) params[0], (String) params[1]);
            }
            catch (ParseException e)
            {
                throw new ExpressionRuntimeException(
                    CoreMessages.createStaticMessage("Unable to parse string as a date using format '"
View Full Code Here

Examples of org.openntf.domino.DateTime

    createDiscussionDocument(db, null, users, new int[] { 0 }, disc_rootDocs);
  }

  void createDiscussionDocument(Database db, Document parent, ArrayList<String> users, int[] pos, int nDoc)
      throws IOException {
    DateTime date = db.getParent().createDateTime(new Date());
    String[] loremIpsum = SampleDataUtil.readLoremIpsum();
    for (int j = 0; j < nDoc; j++) {
      pos[pos.length - 1] = j + 1;

      Document doc = db.createDocument();
      doc.replaceItemValue("Form", "Discussion");
      StringBuilder b = new StringBuilder();
      for (int i = 0; i < pos.length; i++) {
        if (i > 0) {
          b.append("/");
        }
        b.append(pos[i]);
      }
      int idx = (int) (Math.random() * (loremIpsum.length - 1));
      String body = loremIpsum[idx];
      int dot = body.indexOf('.');
      if (dot < 0) {
        dot = body.length() - 1;
      }
      int coma = body.indexOf(',');
      if (coma < 0) {
        coma = body.length() - 1;
      }
      String title = body.substring(0, Math.min(dot, coma));

      // Get a random author
      int x = Math.min((int) (Math.random() * (users.size())), users.size());
      String author = users.get(x);

      doc.replaceItemValue("Title", title);
      doc.replaceItemValue("Body", body);
      doc.replaceItemValue("Author", author);
      doc.replaceItemValue("Date", date);
      if (parent != null) {
        doc.makeResponse(parent);
      }
      doc.computeWithForm(false, false);
      doc.save();

      if (pos.length < disc_maxDepth) {
        double r = Math.random();
        if (r <= (1.0 / pos.length)) {
          int[] newPos = new int[pos.length + 1];
          System.arraycopy(pos, 0, newPos, 0, pos.length);
          int n = (int) (Math.random() * 5);
          createDiscussionDocument(db, doc, users, newPos, n);
        }
      }
      // Move the date to the day before if requested
      boolean mvd = Math.random() <= 0.40;
      if (mvd) {
        // Previous day...
        date.adjustDay(-1);
      }
    }
  }
View Full Code Here

Examples of org.openntf.domino.impl.DateTime

    @Override
    public void run() {
      long start = System.nanoTime();
      Session s = Factory.getSession();
      Date d = new Date();
      DateTime dt = (DateTime) s.createDateTime(d);
      DateTime dt2 = (DateTime) s.createDateTime(d);
      doChecks(dt, dt2);
      dt.adjustHour(1);
      doChecks(dt, dt2);
      dt.adjustDay(-1);
      doChecks(dt, dt2);
View Full Code Here

Examples of org.openntf.formula.DateTime

    int hour = readInteger();
    int minute = readInteger();
    int second = readInteger();
    if (iFormatter == null)
      iFormatter = new FormatterImpl(Locale.getDefault());
    DateTime ret = iFormatter.getNewSDTInstance();
    ret.setLocalDate(year, month, day);
    ret.setLocalTime(hour, minute, second, 0);
    return ret;
  }
View Full Code Here

Examples of pt.opensoft.util.DateTime

                    case Types.TINYINT:
                        varWriter.writeNumeric(rs.getString(i), meta.getColumnDisplaySize(i));
                        break;
                    case Types.DATE:
                    case Types.TIMESTAMP:
                        varWriter.writeDate(new DateTime(new Date(rs.getDate(i).getTime())), "yyyyMMdd");
                        break;
                    default:
                        varWriter.writeString(rs.getString(i), meta.getColumnDisplaySize(i));
                }
            }
View Full Code Here

Examples of railo.runtime.type.dt.DateTime

        data.append(',');
        data.append("\"web-0\"");
       
        data.append(',');
       
        DateTime date = new DateTimeImpl();
        // Date
        data.append('"');
        data.append(dateFormat.format(date,"mm/dd/yyyy",TimeZone.getDefault()));
        data.append('"');
       
View Full Code Here

Examples of visad.DateTime

        convertCal.set(Calendar.MONTH, month - 1);
        convertCal.set(Calendar.DAY_OF_MONTH, day);
        convertCal.set(Calendar.HOUR_OF_DAY, hour);
        convertCal.set(Calendar.MINUTE, min);
        convertCal.set(Calendar.SECOND, sec);
        return new DateTime(convertCal.getTime());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.