diff --git a/lib/libc/time/strptime.3 b/lib/libc/time/strptime.3 index 43cc41916634..2c6defadb8cf 100644 --- a/lib/libc/time/strptime.3 +++ b/lib/libc/time/strptime.3 @@ -1,6 +1,6 @@ -.\" $NetBSD: strptime.3,v 1.19 2008/04/25 14:37:00 ginsbach Exp $ +.\" $NetBSD: strptime.3,v 1.20 2008/04/25 20:51:10 ginsbach Exp $ .\" -.\" Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. +.\" Copyright (c) 1997, 1998, 2008 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This file was contributed to The NetBSD Foundation by Klaus Klein. @@ -119,6 +119,9 @@ the date as %m/%d/%y. .It Cm \&%e the same as .Cm \&%d . +.It Cm \&%F +the date as %Y-%m-%d +(the ISO 8601 date format). .It Cm \&%h the same as .Cm \&%b . diff --git a/lib/libc/time/strptime.c b/lib/libc/time/strptime.c index d79c663da0d5..60e783b71120 100644 --- a/lib/libc/time/strptime.c +++ b/lib/libc/time/strptime.c @@ -1,7 +1,7 @@ -/* $NetBSD: strptime.c,v 1.26 2008/04/24 21:34:48 ginsbach Exp $ */ +/* $NetBSD: strptime.c,v 1.27 2008/04/25 20:51:10 ginsbach Exp $ */ /*- - * Copyright (c) 1997, 1998, 2005 The NetBSD Foundation, Inc. + * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc. * All rights reserved. * * This code was contributed to The NetBSD Foundation by Klaus Klein. @@ -38,7 +38,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: strptime.c,v 1.26 2008/04/24 21:34:48 ginsbach Exp $"); +__RCSID("$NetBSD: strptime.c,v 1.27 2008/04/25 20:51:10 ginsbach Exp $"); #endif #include "namespace.h" @@ -130,6 +130,11 @@ literal: LEGAL_ALT(0); goto recurse; + case 'F': /* The date as "%Y-%m-%d". */ + new_fmt = "%Y-%m-%d"; + LEGAL_ALT(0); + goto recurse; + case 'R': /* The time as "%H:%M". */ new_fmt = "%H:%M"; LEGAL_ALT(0);