Examples of NSTimestamp


Examples of com.webobjects.foundation.NSTimestamp

    _guessingEarly = guessingEarly;
  }

  @Override
  public NSTimestamp parseObject(String text) throws ParseException {
    NSTimestamp parsedTimestamp = null;
    try {
      // Attempt to parse the string with the given pattern.
      Date parsedDate = super.parse(text);
      parsedTimestamp = new NSTimestamp(parsedDate);
    }
    catch (ParseException e) {
      // If the input doesn't match the pattern, use Chronic to parse the
      // input.
      Span span = Chronic.parse(text, options());
      if (span == null) {
        throw e;
      }
      if (span.isSingularity() || isGuessingEarly()) {
        parsedTimestamp = new NSTimestamp(span.getBeginCalendar().getTime());
      }
      else {
        parsedTimestamp = new NSTimestamp(span.getEndCalendar().getTime());
      }
    }
    return parsedTimestamp;
  }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestamp

      super.appendToResponse(response, context);
    }

    public NSTimestamp now() {
      return new NSTimestamp();
    }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestamp

  public UpdateContainerInContainer(WOContext context) {
    super(context);
  }

  public NSTimestamp now() {
    return new NSTimestamp();
  }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestamp

  }
 
  @Override
  public void willInsert() {
    super.willInsert();
    setModificationTime(new NSTimestamp());
  }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestamp

  }
 
  @Override
  public void willUpdate() {
    super.willUpdate();
    setModificationTime(new NSTimestamp());
  }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestamp

  protected boolean useDefaultComponentCSS() {
    return true;
  }

  public WOActionResults generateNotification() {
    session().addNotification("This is a notification from an Ajax request on " + new NSTimestamp());
    return null;
  }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestamp

    cal.set(Calendar.DAY_OF_MONTH, _day);
    cal.set(Calendar.HOUR_OF_DAY, _hour);
    cal.set(Calendar.MINUTE, _minute);
    cal.set(Calendar.SECOND, _second);
    cal.set(Calendar.MILLISECOND, _millisecond);
    NSTimestamp timestamp = new NSTimestamp(cal.getTime().getTime());
    return timestamp;
  }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestamp

  }

  public static NSTimestamp daysFrom(int numberOfDays, Date timestamp) {
    Calendar cal = getCalendarFromTimestamp(timestamp);
    cal.add(Calendar.DATE, numberOfDays);
    return new NSTimestamp(cal.getTime());
  }
View Full Code Here

Examples of com.webobjects.foundation.NSTimestamp

    if (DateUtils.isOnTheSameDay(start, end)) {
      return new NSArray(new Day(start));
    }

    if (end.before(start)) {
      NSTimestamp temp = start;
      start = end;
      end = temp;
    }

    NSMutableArray dates = new NSMutableArray();
View Full Code Here

Examples of com.webobjects.foundation.NSTimestamp

    results += String.format("%02d", Integer.valueOf(minutes));
    return results;
  }

  public static void main(String[] args) {
    NSTimestamp start = new NSTimestamp();
    NSTimestamp end = new NSTimestamp().timestampByAddingGregorianUnits(0, 0, 0, 0, 15, 0);
    System.out.println("start: " + start);
    System.out.println("end: " + end);
    System.out.println("duration: " + DateUtils.durationStringForURL(start, end));
  }
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.