Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSTimestampFormatter.format()


        formatDateTime = new NSTimestampFormatter("%m/%d/%Y %I:%M %p");
      }
      else {
        formatDateTime = new NSTimestampFormatter("%m/%d/%Y");
      }
      return formatDateTime.format(time);
    }
    return null;
  }

  public String mdy(NSTimestamp time) {
View Full Code Here


  }

  public String mdy(NSTimestamp time) {
    if(time != null) {
      NSTimestampFormatter formatDateTime = new NSTimestampFormatter("%m/%d/%Y");
      return formatDateTime.format(time);
    }
    return null;
  }
 
  public String ago(NSTimestamp time) {
View Full Code Here

  }
 
  public String timeOnly(NSTimestamp time) {
    if (time != null) {
      NSTimestampFormatter formatDateTime = new NSTimestampFormatter("%I:%M%p");
      String results = formatDateTime.format(time);
      results = results.toLowerCase();
     
      if(results.charAt(0) == '0') {
        results = results.subSequence(1, results.length()).toString();
     
View Full Code Here

    public String desiredTimestampInDesiredTimeZone() {
      NSTimestampFormatter formatter = new NSTimestampFormatter();
      NSTimeZone tz = NSTimeZone.timeZoneWithName(timeZoneID, false);
      formatter.setDefaultFormatTimeZone(tz);
      StringBuffer buffer = formatter.format(_currentTimestamp, new StringBuffer(), new FieldPosition(0));
      return buffer.toString();
    }
}
View Full Code Here

    return (String)nstFormats.valueForKey(currentNSTFormat);
  }

  public String currentFormattedNST() {
    NSTimestampFormatter formatter = new NSTimestampFormatter(currentNSTFormat);
    return formatter.format(currentTS());
  }

  public NSArray sdfKeys = new NSArray(new Object[] { "G", "y", "M", "w", "W", "D", "d", "F", "E", "a", "H", "k", "K", "h", "m", "s", "S", "z", "Z"} );

  NSDictionary sdfFormats = new NSDictionary(sdfExplains, sdfKeys);
View Full Code Here

    private static void backupSiteConfig() {
        try {
            File sc = fileForSiteConfig();
            if ( sc.exists() ) {
                NSTimestampFormatter formatter = new NSTimestampFormatter("%Y%m%d%H%M%S%F");
                File renamedFile = new File(pathForSiteConfig() + "." + formatter.format(new NSTimestamp()));
                sc.renameTo(renamedFile);
            }
        } catch (NSForwardException ne) {
            log.error("Cannot backup file " + pathForSiteConfig() + ". Possible Permissions Problem.");
        }
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.