Package java.util

Examples of java.util.Date


       
        if (fields.length < MIN_EXPECTED_FIELD_COUNT)
            return null;
        
        // first two fields are date time
        Date lastModified = null;
        try {
            lastModified = formatter.parse(fields[0] + " " + fields[1]);
        }
        catch (ParseException ex) {
            if (!ignoreDateParseErrors) {
View Full Code Here


   */
  //@ requires isDate();
  public /*@pure@*/ String formatDate(double date) {
    switch (m_Type) {
    case DATE:
      return m_DateFormat.format(new Date((long)date));
    default:
      throw new IllegalArgumentException("Can only format date values for date"
                                         + " attributes!");
    }
  }
View Full Code Here

      System.out.println(date);
      double dd = date.parseDate("2001-04-04 14:13:55");
      System.out.println("Test date = " + dd);
      System.out.println(date.formatDate(dd));

      dd = new Date().getTime();
      System.out.println("Date now = " + dd);
      System.out.println(date.formatDate(dd));
     
      // Create vector to hold nominal values "first", "second", "third"
      List<String> my_nominal_values = new ArrayList<String>(3);
View Full Code Here

 
  private static Log log = LogFactory.getLog(TilesLoggingInterceptor.class);
 
  public void beforeExecute(Object action, ActionContext context)
  {
    log.info("Before execution of action in tiles module " + action.getClass().getName() + " at date " + new Date());
  }
View Full Code Here

    log.info("Before execution of action in tiles module " + action.getClass().getName() + " at date " + new Date());
  }

  public void afterExecute(Object action, ActionContext context, Exception e)
  {
    log.info("Aftere execution of action in tiles module " + action.getClass().getName() + " at date " + new Date());
  }
View Full Code Here

        }
        return false;
    }

      public static String getSystemTime(String dateFormat) {
            return new SimpleDateFormat(dateFormat).format(new Date());
      }
View Full Code Here

  {

    DatePatternConverter converter = new DatePatternConverter("d MMMM yyyy");

    String stringVal = "19 July 2005";
    Date object = converter.toTargetType(stringVal);
    String result = converter.toSourceType(object);

    assert result.equals(stringVal);

    // now check null and blank case
View Full Code Here

    Project project = new Project();
    form.setProject(project);

    project.setProjectType(new ProjectType());
    project.setProjectName("my project");
    project.setReadyDate(new Date());

    delegator.bindOutwards(null);

    // because the ProjectType has no ID set, this will be null. A log message should be set
    assert form.getSelectedProjectType() == null;
View Full Code Here

    Project project = new Project();
    form.setProject(project);

    project.setProjectType(projectType1);
    project.setProjectName("my project");
    project.setReadyDate(new Date());

    delegator.bindOutwards(null);

    assert form.getSelectedProjectType() != null;
    assert form.getProjectName() != null;
View Full Code Here

  {

    FullDateConverter converter = new FullDateConverter();

    String stringVal = "19 July 2005";
    Date object = converter.toTargetType(stringVal);
    String result = converter.toSourceType(object);

    assert result.equals(stringVal);

    // now check null and blank case
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.