r=gagan. 10551. FTP date parsing is fixed

This commit is contained in:
valeski%netscape.com 2000-02-09 08:04:45 +00:00
Родитель c723a257bd
Коммит 934a4efca1
1 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -594,6 +594,25 @@ nsFTPDirListingConv::ConvertUNIXDate(char *aCStr, PRExplodedTime& outDate) {
PRExplodedTime nowETime;
PR_ExplodeTime(PR_Now(), PR_LocalTimeParameters, &nowETime);
curTime.tm_year = nowETime.tm_year;
PRBool thisCalendarYear = PR_FALSE;
if (nowETime.tm_month > curTime.tm_month) {
thisCalendarYear = PR_TRUE;
} else if (nowETime.tm_month == curTime.tm_month
&& nowETime.tm_mday > curTime.tm_mday) {
thisCalendarYear = PR_TRUE;
} else if (nowETime.tm_month == curTime.tm_month
&& nowETime.tm_mday == curTime.tm_mday)
&& nowETime.tm_hour > curTime.tm_hour) {
thisCalendarYear = PR_TRUE;
} else if (nowETime.tm_month == curTime.tm_month
&& nowETime.tm_mday == curTime.tm_mday
&& nowETime.tm_hour == curTime.tm_hour
&& nowETime.tm_min >= curTime.tm_min) {
thisCalendarYear = PR_TRUE;
}
if (!thisCalendarYear) curTime.tm_year--;
}
// set the out param