Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002163 [Quercus] major always 11-10-07 21:03 11-14-07 21:07
Reporter catkins View Status public  
Assigned To nam
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.1.4 Product Version 3.0.23
  Product Build
Summary 0002163: mktime
Description mktime does not conform to behavior required for out-of-range values. See below for new version that passes examples given on php documentation.
Steps To Reproduce
Additional Information   /**
   * Returns the formatted date.
   */
  public long mktime(Env env,
                     @Optional("-1") int hour,
             @Optional("-1") int minute,
             @Optional("-1") int second,
             @Optional("-1") int month,
             @Optional("-2147483648") int day,
             @Optional("-1") int year,
                     @Optional("-1") int isDST)
  {
    if (isDST != -1)
      env.deprecatedArgument("isDST");

    QDate date = new QDate(true);

    long now = Alarm.getCurrentTime();

    date.setLocalTime(now);

    if (year >= 0 && year <= 69)
        year += 2000;
    else if (year >= 70 && year <= 100)
        year += 1900;

    if (year > 0)
      date.setYear(year);

    if (month > 0)
      date.setMonth(month - 1);

    if (day != -2147483648)
      date.setDayOfMonth(day);

    if (hour >= 0)
      date.setHour(hour);

    if (minute >= 0)
      date.setMinute(minute);

    if (second >= 0)
      date.setSecond(second);

    return date.getGMTTime() / 1000L;
  }

Attached Files

- Relationships

- Notes
(0002495)
nam
11-14-07 21:07

php/190m
 

- Issue History
Date Modified Username Field Change
11-10-07 21:03 catkins New Issue
11-14-07 10:31 nam Status new => assigned
11-14-07 10:31 nam Assigned To  => nam
11-14-07 21:07 nam Status assigned => closed
11-14-07 21:07 nam Note Added: 0002495
11-14-07 21:07 nam Resolution open => fixed
11-14-07 21:07 nam Fixed in Version  => 3.1.4


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker