Examples of NSTimestampFormatter


Examples of com.webobjects.foundation.NSTimestampFormatter

          else {
            timestampFormat = ERXProperties.stringForKeyWithDefault("er.rest.timestampFormat.primary", "%Y-%m-%dT%H:%M:%SZ");
          }
        }
      }
      timestampFormatter = new NSTimestampFormatter(timestampFormat);
    }
    return timestampFormatter;
  }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestampFormatter

            if (numberFormat != null) {
                _format = new NSNumberFormatter(numberFormat);
            }
            String dateformat = (String) dict.objectForKey("dateformat");
            if (dateformat != null) {
                _format = new NSTimestampFormatter(dateformat);
            }
        }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestampFormatter

      if (numberFormat != null) {
        _format = new NSNumberFormatter(numberFormat);
      }
      String dateformat = (String) dict.objectForKey("dateformat");
      if (dateformat != null) {
        _format = new NSTimestampFormatter(dateformat);
      }
    }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestampFormatter

                int index = 0;
                for(Enumeration e = ((NSArray)rawValue).objectEnumerator(); e.hasMoreElements();) {
                    EOAttribute attribute = pks.objectAtIndex(index++);
                    Object value = e.nextElement();
                    if(attribute.adaptorValueType() == EOAttribute.AdaptorDateType && !(value instanceof NSTimestamp)) {
                        value = new NSTimestampFormatter("%Y-%m-%d %H:%M:%S %Z").parseObject((String)value);
                    }
                    value = attribute.validateValue(value);
                    pk.setObjectForKey(value, attribute.name());
                    if(pks.count() == 1) {
                        break;
View Full Code Here

Examples of com.webobjects.foundation.NSTimestampFormatter

    formatString = formatString == null ? ERXTimestampFormatter.DEFAULT_PATTERN : formatString;
    formatString = localizedStringForKeyWithDefault(formatString);
    Format result = _dateFormatters.get(formatString);
    if (result == null) {
      Locale current = locale();
      NSTimestampFormatter formatter = new NSTimestampFormatter(formatString, new DateFormatSymbols(current));
      result = formatter;
      _dateFormatters.put(formatString, result);
    }
    return result;
  }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestampFormatter

            if(className.equals("java.lang.Number"))
                f = new NSNumberFormatter("0");
            if(className.equals("java.lang.BigDecimal"))
                f = new NSNumberFormatter("$#,##0.00;-$#,##0.00");
            if(className.equals("com.webobjects.foundation.NSTimestamp"))
                f = new NSTimestampFormatter("%b %d,%Y");           
           
        }
        return f;
    }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestampFormatter

    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

Examples of com.webobjects.foundation.NSTimestampFormatter

    static private NSMutableDictionary _calFormatDict = new NSMutableDictionary();

    static public Format formatterForFormat(String calFormat) {
        synchronized(_calFormatDict) {
            if(calFormat == null) calFormat = _defaultCalendarFormatString;
            NSTimestampFormatter v = (NSTimestampFormatter)_calFormatDict.objectForKey(calFormat);
            if(v == null) {
                v = new NSTimestampFormatter(calFormat);
                setFormatterForFormat(v, calFormat);
            }
            return v;
        }
    }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestampFormatter

            String currentAttributeName = (String)pkAttributeNames.objectAtIndex( i );
            EOAttribute currentAttribute = entity.attributeNamed( currentAttributeName );
            Object currentValue = values.objectAtIndex( i );
            switch ( currentAttribute.adaptorValueType() ) {
                case 3:
                    NSTimestampFormatter tsf = new NSTimestampFormatter();
                    try {
                        currentValue = tsf.parseObject( (String) currentValue );   
                    } catch( java.text.ParseException ex ) {
                        log.error( "Error while trying to parse: "+currentValue );
                        throw new NSForwardException( ex );
                    }
                    case 1:
View Full Code Here

Examples of com.webobjects.foundation.NSTimestampFormatter

     * of java dates.
     * @return timestamp formatter for java dates.
     */
    public static NSTimestampFormatter gregorianDateFormatterForJavaDate() {
        if (_gregorianDateFormatterForJavaDate == null)
            _gregorianDateFormatterForJavaDate = new NSTimestampFormatter("%a %b %d %H:%M:%S %Z %Y");
        return _gregorianDateFormatterForJavaDate;
    }
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.