Package java.util

Examples of java.util.Date


    result.append("// Generated with Weka " + Version.VERSION + "\n");
    result.append("//\n");
    result.append("// This code is public domain and comes with no warranty.\n");
    result.append("//\n");
    result.append("// Timestamp: " + new Date() + "\n");
    result.append("\n");
    result.append("package weka.classifiers;\n");
    result.append("\n");
    result.append("import weka.core.Attribute;\n");
    result.append("import weka.core.Capabilities;\n");
View Full Code Here


          log.warn("DocumentAge < 0!");
        }
        reScan = maxDocumentAge >= 0 && ageInSeconds > maxDocumentAge;
        if (reScan) {
          long lastModified = doc.getLastModifiedAsMilliSeconds();
          Date lastModifiedDate = new Date(lastModified);
          httpTool.setIfModifiedSince(lastModifiedDate);
        }
      } else {
        httpTool.setIfModifiedSince(null);
      }
View Full Code Here

            catch (NumberFormatException ex) {}
            index++;
        }
       
        int dateTimePos = index;
        Date lastModified = null;
        StringBuffer stamp = new StringBuffer(fields[index++]);
        stamp.append('-');
        if (dayOfMonth > 0)
            stamp.append(dayOfMonth);
        else
            stamp.append(fields[index++]);
        stamp.append('-');
       
        String field = fields[index++];
        if (field.indexOf(':') < 0 && field.indexOf('.') < 0) {
            stamp.append(field); // year
            try {
                lastModified = noHHmmFormatter.parse(stamp.toString());
            }
            catch (ParseException ignore) {
                noHHmmFormatter = (noHHmmFormatter == noHHmmFormatter1 ? noHHmmFormatter2 : noHHmmFormatter1);
                try {
                    lastModified = noHHmmFormatter.parse(stamp.toString());
                }
                catch (ParseException ex) {
                    if (!ignoreDateParseErrors)
                        throw new DateParseException(ex.getMessage());
                }
            }
        }
        else { // add the year ourselves as not present
            Calendar cal = Calendar.getInstance();
            int year = cal.get(Calendar.YEAR);
            stamp.append(year).append('-').append(field);
            lastModified = parseTimestamp(stamp.toString());
           
            // can't be in the future - must be the previous year
            // add 2 days just to allow for different time zones
            cal.add(Calendar.DATE, 2);
            if (lastModified != null && lastModified.after(cal.getTime())) {
                cal.setTime(lastModified);
                cal.add(Calendar.YEAR, -1);
                lastModified = cal.getTime();
            }
        }
View Full Code Here

    } else {
      vals[i - 1] = (double)fl;
    }
    break;
  case DATE:
          Date date = rs.getDate(i);
          if (rs.wasNull()) {
      vals[i - 1] = Utils.missingValue();
    } else {
            // TODO: Do a value check here.
            vals[i - 1] = (double)date.getTime();
          }
          break;
  case TIME:
          Time time = rs.getTime(i);
          if (rs.wasNull()) {
View Full Code Here

    throw new CookieException("max-age must be integer, but is "
            +fieldvalue);   
  }
 
  if (maxAge >= 0) {
    this.expireDate = new Date(System.currentTimeMillis()
             +maxAge*1000);
  } else {
    this.expireDate = new Date(Long.MAX_VALUE);
  }
      } else if (fieldname.equalsIgnoreCase("expires")) {
  //
  // EXPIRES
  //
View Full Code Here

  /**
   * Is this cookie valid ?
   * @return true if the cookie is valid, false if it is expired
   */
  public boolean isValid() {
    Date current = new Date();
    return current.before(expireDate);
  }
View Full Code Here

        stamp.append('-');
        stamp.append(year);
        stamp.append('-');
        stamp.append(time);
       
        Date lastModified = null;
        try {
            lastModified = dateFormatter.parse(stamp.toString());
        }
        catch (ParseException ex) {
            if (!ignoreDateParseErrors)
                throw new DateParseException(ex.getMessage());
        }
                 
        // can't be in the future - must be the previous year
        // add 2 days just to allow for different time zones
        cal.add(Calendar.DATE, 2);
        if (lastModified != null && lastModified.after(cal.getTime())) {
            cal.setTime(lastModified);
            cal.add(Calendar.YEAR, -1);
            lastModified = cal.getTime();
        }
               
View Full Code Here

    int testMode = 0;
    int percent = 66;
    Clusterer clusterer = (Clusterer) m_ClustererEditor.getValue();
    Clusterer fullClusterer = null;
    StringBuffer outBuff = new StringBuffer();
    String name = (new SimpleDateFormat("HH:mm:ss - ")).format(new Date());
    String cname = clusterer.getClass().getName();
    if (cname.startsWith("weka.clusterers.")) {
      name += cname.substring("weka.clusterers.".length());
    } else {
      name += cname;
View Full Code Here

      m_Log.statusMessage("OK");
     
      if (clusterer != null) {
  m_Log.logMessage("Loaded model from file '" + selected.getName()+ "'");
  String name = (new SimpleDateFormat("HH:mm:ss - ")).format(new Date());
  String cname = clusterer.getClass().getName();
  if (cname.startsWith("weka.clusterers."))
    cname = cname.substring("weka.clusterers.".length());
  name += cname + " from file '" + selected.getName() + "'";
  StringBuffer outBuff = new StringBuffer();
View Full Code Here

        List<ProcessInstanceLog> result = getEntityManager().createQuery(
            "from ProcessInstanceLog as log where log.processInstanceId = ? and log.end is null")
                .setParameter(1, processInstanceId).getResultList();
        if (result != null && result.size() != 0) {
            ProcessInstanceLog log = result.get(result.size() - 1);
            log.setEnd(new Date());
            getEntityManager().merge(log);
        }
    }
View Full Code Here

TOP

Related Classes of java.util.Date

Copyright © 2018 www.massapicom. 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.