Examples of QDate


Examples of com.caucho.util.QDate

    if (month > 12) {
      month -= 12;
      year += 1;
    }

    QDate localCalendar = env.getLocalDate();

    localCalendar.setHour(0);
    localCalendar.setMinute(0);
    localCalendar.setSecond(0);
    localCalendar.setDayOfMonth((int) day);
    localCalendar.setMonth((int) (month - 1));
    localCalendar.setYear((int) year);

    return localCalendar.getLocalTime() / 1000L;
  }
View Full Code Here

Examples of com.caucho.util.QDate

  }
 
  public static Value date_parse(String date)
  {
    DateTime dateTime = new DateTime(date);
    QDate qDate = dateTime.getQDate();
   
    ArrayValue array = new ArrayValueImpl();
   
    array.put("year", qDate.getYear());
    array.put("month", qDate.getMonth() + 1);
    array.put("day", qDate.getDayOfMonth());
    array.put("hour", qDate.getHour());
    array.put("minute", qDate.getMinute());
    array.put("second", qDate.getSecond());
    array.put("fraction", qDate.getMillisecond() / 1000.0);
   
    //warning_count
    //warnings
    //error_count
    //errors
View Full Code Here

Examples of com.caucho.util.QDate

    this(timeString, new DateTimeZone());
  }
 
  protected DateTime(String timeString, DateTimeZone dateTimeZone)
  {
    _qDate = new QDate(dateTimeZone.getTimeZone());
    _dateTimeZone = dateTimeZone;
   
    init(timeString);
  }
View Full Code Here

Examples of com.caucho.util.QDate

  {
    _dateTimeZone = dateTimeZone;
   
    long time = _qDate.getGMTTime();
   
    _qDate = new QDate(dateTimeZone.getTimeZone());
    _qDate.setGMTTime(time);
  }
View Full Code Here

Examples of com.caucho.util.QDate

  /**
   * Returns the days in a given month.
   */
  public static int cal_days_in_month(int cal, int month, int year)
  {
    QDate date = new QDate();

    date.setYear(year);
    date.setMonth(month - 1);

    return date.getDaysInMonth();
  }
View Full Code Here

Examples of com.caucho.util.QDate

  /**
   * Returns the timestamp of easter.
   */
  public static long easter_date(@Optional("-1") int year)
  {
    QDate date = new QDate();
   
    if (year < 0) {
      date.setGMTTime(Alarm.getCurrentTime());
     
      year = date.getYear();
    }

    int y = year;

    int c = y / 100;
    int n = y - 19 * (y / 19);
    int k = (c - 17) / 25;
    int i = c - c /4 - (c - k) / 3 + 19 * n + 15;
    i = i - 30 * (i / 30);
    i = i - (i / 28) * (1 - ((i / 28) *
           (29 / (i + 1)) *
           ((21 - n) / 11)));

    int j = y + y / 4 + i + 2 - c + c / 4;
    j = j - 7 * (j / 7);
    int l = i - j;
    int m = 3 + (l + 40) / 44;
    int d = l + 28 - 31 * (m / 4);

    date.setYear(year);
    date.setMonth(m - 1);
    date.setDayOfMonth(d);

    return date.getGMTTime() / 1000;
  }
View Full Code Here

Examples of com.caucho.util.QDate

  /**
   * Returns an array of the current date.
   */
  public Value getdate(@Optional("time()") long time)
  {
    QDate date = new QDate(false);

    date.setLocalTime(1000 * time);

    ArrayValue array = new ArrayValueImpl();

    array.put("seconds", date.getSecond());
    array.put("minutes", date.getMinute());
    array.put("hours", date.getHour());
    array.put("mday", date.getDayOfMonth());
    array.put("wday", date.getDayOfWeek() - 1);
    array.put("mon", date.getMonth() + 1);
    array.put("year", date.getYear());
    array.put("yday", date.getDayOfYear());
    array.put("weekday", _fullDayOfWeek[date.getDayOfWeek() - 1]);
    array.put("month", _fullMonth[date.getMonth()]);
    array.put(LongValue.ZERO, LongValue.create(time));

    return array;
  }
View Full Code Here

Examples of com.caucho.util.QDate

                       @Optional() Value secondV,
                       @Optional() Value monthV,
                       @Optional() Value dayV,
                       @Optional() Value yearV)
  {
    QDate date = env.getGmtDate();
    long now = Alarm.getCurrentTime();

    date.setLocalTime(now);

    long gmtNow = date.getGMTTime();

    date.setGMTTime(gmtNow);

    setMktime(date, hourV, minuteV, secondV, monthV, dayV, yearV);

    return date.getGMTTime() / 1000L;
  }
View Full Code Here

Examples of com.caucho.util.QDate

  {
    if (isGMT) {
      return dateImpl(format, time, env.getGmtDate());
    }
    else {
      QDate calendar;
     
      if (env.getDefaultTimeZone() != null)
  calendar = new QDate(env.getDefaultTimeZone());
      else
  calendar = env.getLocalDate();

      return dateImpl(format, time, calendar);
    }
View Full Code Here

Examples of com.caucho.util.QDate

    long year;
    long wday;
    long yday;
    long isdst;

    QDate localCalendar = env.getLocalDate();

    localCalendar.setGMTTime(time);

    sec = localCalendar.getSecond();
    min = localCalendar.getMinute();
    hour = localCalendar.getHour();
    mday = localCalendar.getDayOfMonth();
    mon = localCalendar.getMonth();
    year = localCalendar.getYear();
    wday = localCalendar.getDayOfWeek();
    yday = localCalendar.getDayOfYear();
    isdst = localCalendar.isDST() ? 1 : 0;

    year = year - 1900;
    wday = wday - 1;
   
    ArrayValue value = new ArrayValueImpl();
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.