summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorwes <wes@FreeBSD.org>1999-04-25 07:28:39 +0000
committerwes <wes@FreeBSD.org>1999-04-25 07:28:39 +0000
commite94ed693cb7c6a21b4aece3d34332825285f2df6 (patch)
treeebf1090570d6d67a8f9af835c31142dbea1aa68f /lib
parente7b80ea5adc83d04893fefbdd4b67ee7922a6da2 (diff)
downloadFreeBSD-src-e94ed693cb7c6a21b4aece3d34332825285f2df6.zip
FreeBSD-src-e94ed693cb7c6a21b4aece3d34332825285f2df6.tar.gz
Re-fixed to start at 1969 per the actual Posix requirement. Also
fixed a typo on the man page.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdtime/strptime.310
-rw-r--r--lib/libc/stdtime/strptime.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/libc/stdtime/strptime.3 b/lib/libc/stdtime/strptime.3
index b5dedbe..8e74a13 100644
--- a/lib/libc/stdtime/strptime.3
+++ b/lib/libc/stdtime/strptime.3
@@ -23,7 +23,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: strptime.3,v 1.2 1998/09/12 21:13:29 dt Exp $
+.\" $Id: strptime.3,v 1.3 1999/04/25 01:42:18 wes Exp $
.\" "
.Dd May 8, 1997
.Dt STRPTIME 3
@@ -58,12 +58,12 @@ All conversion specifications are identical to those described in
.Xr strftime 3 .
.Pp
Two-digit year values, including formats
-.Fa %d
+.Fa %y
and
.Fa %D ,
-are now interpreted as beginning at 1970 per POSIX requirements.
-Years 70-99 are interpreted in the 20th century, years 00-69 in
-the 21st century.
+are now interpreted as beginning at 1969 per POSIX requirements.
+Years 69-00 are interpreted in the 20th century (1969-2000), years
+01-68 in the 21st century (2001-2068).
.Sh RETURN VALUES
Upon successful completion,
.Fn strptime
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index f121d68..27437fe 100644
--- a/lib/libc/stdtime/strptime.c
+++ b/lib/libc/stdtime/strptime.c
@@ -53,7 +53,7 @@
#ifdef LIBC_RCS
static const char rcsid[] =
- "$Id: strptime.c,v 1.4 1998/09/12 21:13:29 dt Exp $";
+ "$Id: strptime.c,v 1.5 1999/04/25 01:42:18 wes Exp $";
#endif
#ifndef lint
@@ -333,7 +333,7 @@ strptime(const char *buf, const char *fmt, struct tm *tm)
}
if (c == 'Y')
i -= 1900;
- if (c == 'y' && i < 70)
+ if (c == 'y' && i < 69)
i += 100;
if (i < 0)
return 0;
OpenPOWER on IntegriCloud