Package hirondelle.web4j.model

Examples of hirondelle.web4j.model.DateTime


    if(fLogger.getLevel() == Level.FINEST){
      fLogger.finest("DateTime column, raw value from database is: " + Util.quote(rawDateTime) +
       ". SQL date-time formatting functions can be used to render the format compatible with the hirondelle.web4.model.DateTime class, if needed."
      );
    }
    return rawDateTime == null ? null new DateTime(rawDateTime);
  }
View Full Code Here


      aStatement.setTimestamp(aIdx, timestampSql);
    }
  }
 
  private void setDateTime(Object aParam, PreparedStatement aStatement, int aIdx) throws SQLException {
    DateTime dateTime = (DateTime)aParam;
    String formattedDateTime = "";
    if (
      dateTime.unitsAllPresent(Unit.YEAR, Unit.MONTH, Unit.DAY) &&
      dateTime.unitsAllAbsent(Unit.HOUR, Unit.MINUTE, Unit.SECOND)
    ){
      fLogger.finest("Treating DateTime as a date (year-month-day).");
      formattedDateTime = dateTime.format(DbConfig.getDateFormat(fSqlId.getDatabaseName()));
    }
    else if (
      dateTime.unitsAllAbsent(Unit.YEAR, Unit.MONTH, Unit.DAY) &&
      dateTime.unitsAllPresent(Unit.HOUR, Unit.MINUTE, Unit.SECOND)
    ){
      fLogger.finest("Treating DateTime as a time (hour-minute-second).");
      formattedDateTime = dateTime.format(DbConfig.getTimeFormat(fSqlId.getDatabaseName()));
    }
    else if (
      dateTime.unitsAllPresent(Unit.YEAR, Unit.MONTH, Unit.DAY) &&
      dateTime.unitsAllPresent(Unit.HOUR, Unit.MINUTE, Unit.SECOND)
    ) {
      fLogger.finest("Treating DateTime as a date+time (year-month-day-hour-minute-second).");
      formattedDateTime = dateTime.format(DbConfig.getDateTimeFormat(fSqlId.getDatabaseName()));
    }
    else {
      String message =
         "Unable to format DateTime using the DateTimeFormatForPassingParamsToDb setting in web.xml." +
         " The units present in the DateTime object do not match any of the expected combinations. " +
View Full Code Here

      parseLoggers();
      createFileHandler();
      attachLoggersToFileHandler();
      tryTestMessages();
      fLogger.config("Logging to directory : " + Util.quote(fLoggingDir.getValue()));
      DateTime now = DateTime.now(getTimeZone());
      fLogger.config("Current date-time: " + now.format("YYYY-MM-DD hh:mm:ss.fffffffff") + " (uses your TimeSource implementation and the DefaultUserTimeZone setting in web.xml)");
      fLogger.config("Raw value of System.currentTimeMillis(): " + System.currentTimeMillis());
      showLoggerLevels();
    }
  }
View Full Code Here

   Return the complete name of the logging file.
   Example file name : <tt>C:\log\fish_and_chips\2007_12_31_23_59.txt</tt>
  */
  private String getFileName(){
    String result = null;
    DateTime now = DateTime.now(getTimeZone());
    result = fLoggingDir.getValue() + now.format("YYYY|_|MM|_|DD|_|hh|_|mm");
    result = result + ".txt";
    logStdOut("Logging file name : " + Util.quote(result));
    return result;
  }
View Full Code Here

TOP

Related Classes of hirondelle.web4j.model.DateTime

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.