Examples of NSTimestamp


Examples of com.webobjects.foundation.NSTimestamp

    String formattedValue;
    if (value == null || value instanceof NSKeyValueCoding.Null) {
      formattedValue = null;
    }
    else if (value instanceof NSTimestamp) {
      NSTimestamp timestamp = (NSTimestamp) value;
      String rfcFormat = ERXProperties.stringForKeyWithDefault("er.rest.rfcDateFormat", "rfc822");
      if ("rfc3339".equals(rfcFormat)) {
        formattedValue = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date(timestamp.getTime()));
        formattedValue = formattedValue.substring(0, formattedValue.length()-2) + ":" + formattedValue.substring(formattedValue.length()-2);         
      } else {
        formattedValue = ERXRestUtils.timestampFormat(false, context).format(timestamp);
      }
    }
View Full Code Here

Examples of ns.foundation.NSTimestamp

    assertEquals(Integer.valueOf(2), sorted.objectAtIndex(0));
    assertEquals(Integer.valueOf(1), sorted.objectAtIndex(1));
  }
 
  public void testSortedArrayUsingComparatorTimestamp() throws ComparisonException {
    NSTimestamp earlierTime = new NSTimestamp();
    NSTimestamp laterTime = earlierTime.timestampByAddingGregorianUnits(0, 1, 0, 0, 0, 0);
    NSArray<NSTimestamp> array = new NSArray<NSTimestamp>(new NSTimestamp[] { earlierTime, laterTime });
    NSArray<NSTimestamp> sorted = array.sortedArrayUsingComparator(NSComparator.AscendingTimestampComparator);
    assertEquals(earlierTime, sorted.objectAtIndex(0));
    assertEquals(laterTime, sorted.objectAtIndex(1));
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.