Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSTimestamp


    Calendar nowCalendar = Calendar.getInstance();
    Calendar cal = Calendar.getInstance();
    cal.setTime(myStartDate);
    cal.set(Calendar.HOUR_OF_DAY, nowCalendar.get(Calendar.HOUR_OF_DAY));
    cal.set(Calendar.MINUTE, nowCalendar.get(Calendar.MINUTE));
    NSTimestamp now = new NSTimestamp(cal.getTime());
    return now;
  }
View Full Code Here


    cal.setTime(myStartDate);
    cal.set(Calendar.HOUR_OF_DAY, 9);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    cal.set(Calendar.MILLISECOND, 0);
    NSTimestamp workStart = new NSTimestamp(cal.getTime());
    return workStart;
  }
View Full Code Here

    cal.setTime(myEndDate);
    cal.set(Calendar.HOUR_OF_DAY, 18);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    cal.set(Calendar.MILLISECOND, 0);
    NSTimestamp workEnd = new NSTimestamp(cal.getTime());
    return workEnd;
  }
View Full Code Here

  }

  public Day monthsAgo(int months) {
    Calendar cal = startCalendar();
    cal.add(Calendar.MONTH, -1 * months);
    return new Day(new NSTimestamp(cal.getTime()));
  }
View Full Code Here

  }

  public Day monthsFromNow(int months) {
    Calendar cal = startCalendar();
    cal.add(Calendar.MONTH, months);
    return new Day(new NSTimestamp(cal.getTime()));
  }
View Full Code Here

  }

  public Day yearsAgo(int years) {
    Calendar cal = startCalendar();
    cal.add(Calendar.YEAR, -1 * years);
    return new Day(new NSTimestamp(cal.getTime()));
  }
View Full Code Here

  }

  public Day yearsFromNow(int years) {
    Calendar cal = startCalendar();
    cal.add(Calendar.YEAR, 1 * years);
    return new Day(new NSTimestamp(cal.getTime()));
  }
View Full Code Here

  }

  public Day daysAgo(int days) {
    Calendar cal = startCalendar();
    cal.add(Calendar.DATE, -1 * days);
    return new Day(new NSTimestamp(cal.getTime()));
  }
View Full Code Here

  }

  public Day daysFromNow(int days) {
    Calendar cal = startCalendar();
    cal.add(Calendar.DATE, days);
    return new Day(new NSTimestamp(cal.getTime()));
  }
View Full Code Here

  public Day weeksAgo(int weeks) {
    int days  = weeks * 7;
    Calendar cal = startCalendar();
    cal.add(Calendar.DATE, -1 * days);
    return new Day(new NSTimestamp(cal.getTime()));
  }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSTimestamp

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.