mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2025-12-09 15:20:31 +00:00
yet more ISO work
SCCS-file: strftime.c SCCS-SID: 7.43
This commit is contained in:
committed by
Paul Eggert
parent
d614d29fc4
commit
fc291543c1
14
strftime.c
14
strftime.c
@ -295,7 +295,9 @@ label:
|
|||||||
pt = _conv((t->tm_wday == 0) ? 7 : t->tm_wday,
|
pt = _conv((t->tm_wday == 0) ? 7 : t->tm_wday,
|
||||||
"%d", pt, ptlim);
|
"%d", pt, ptlim);
|
||||||
continue;
|
continue;
|
||||||
case 'V':
|
case 'V': /* ISO 8601 week number */
|
||||||
|
case 'G': /* ISO 8601 year (four digits) */
|
||||||
|
case 'g': /* ISO 8601 year (two digits) */
|
||||||
/*
|
/*
|
||||||
** From Arnold Robbins' strftime version 3.0: "the week number of the
|
** From Arnold Robbins' strftime version 3.0: "the week number of the
|
||||||
** year (the first Monday as the first day of week 1) as a decimal number
|
** year (the first Monday as the first day of week 1) as a decimal number
|
||||||
@ -347,6 +349,7 @@ label:
|
|||||||
top += DAYSPERWEEK;
|
top += DAYSPERWEEK;
|
||||||
top += len;
|
top += len;
|
||||||
if (yday >= top) {
|
if (yday >= top) {
|
||||||
|
++year;
|
||||||
w = 1;
|
w = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -360,7 +363,14 @@ label:
|
|||||||
DAYSPERLYEAR :
|
DAYSPERLYEAR :
|
||||||
DAYSPERNYEAR;
|
DAYSPERNYEAR;
|
||||||
}
|
}
|
||||||
pt = _conv(w, "%02d", pt, ptlim);
|
if (*format == 'V')
|
||||||
|
pt = _conv(w, "%02d",
|
||||||
|
pt, ptlim);
|
||||||
|
else if (*format == 'G')
|
||||||
|
pt = _conv(year, "%02d",
|
||||||
|
pt, ptlim);
|
||||||
|
else pt = _conv(year, "%04d",
|
||||||
|
pt, ptlim);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
case 'v':
|
case 'v':
|
||||||
|
|||||||
Reference in New Issue
Block a user