Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/time Add the C99 %F conversion.
details: https://anonhg.NetBSD.org/src/rev/661b19f7cdef
branches: trunk
changeset: 480553:661b19f7cdef
user: kleink <kleink%NetBSD.org@localhost>
date: Sat Jan 15 16:59:05 2000 +0000
description:
Add the C99 %F conversion.
diffstat:
lib/libc/time/strftime.3 | 6 +++++-
lib/libc/time/strftime.c | 8 ++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
diffs (52 lines):
diff -r ef9d38b2416d -r 661b19f7cdef lib/libc/time/strftime.3
--- a/lib/libc/time/strftime.3 Sat Jan 15 15:55:20 2000 +0000
+++ b/lib/libc/time/strftime.3 Sat Jan 15 16:59:05 2000 +0000
@@ -34,7 +34,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)strftime.3 5.12 (Berkeley) 6/29/91
-.\" $NetBSD: strftime.3,v 1.6 1999/02/07 17:33:30 augustss Exp $
+.\" $NetBSD: strftime.3,v 1.7 2000/01/15 16:59:05 kleink Exp $
.\"
.Dd June 29, 1991
.Dt STRFTIME 3
@@ -102,6 +102,10 @@
.It Cm \&%e
is replaced by the day of month as a decimal number [1,31];
single digits are preceded by a blank.
+.It Cm \&%F
+is replaced by the time in the format
+.Dq Li %Y-%m-%d
+(the ISO 8601 date format).
.It Cm \&%G
is replaced by the ISO 8601 year with century as a decimal number.
.TP
diff -r ef9d38b2416d -r 661b19f7cdef lib/libc/time/strftime.c
--- a/lib/libc/time/strftime.c Sat Jan 15 15:55:20 2000 +0000
+++ b/lib/libc/time/strftime.c Sat Jan 15 16:59:05 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: strftime.c,v 1.9 1999/11/05 19:21:12 erh Exp $ */
+/* $NetBSD: strftime.c,v 1.10 2000/01/15 16:59:05 kleink Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -38,7 +38,7 @@
#if 0
static char *sccsid = "@(#)strftime.c 5.11 (Berkeley) 2/24/91";
#else
-__RCSID("$NetBSD: strftime.c,v 1.9 1999/11/05 19:21:12 erh Exp $");
+__RCSID("$NetBSD: strftime.c,v 1.10 2000/01/15 16:59:05 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -154,6 +154,10 @@
if (!_conv(t->tm_mday, 2, ' ', pt, ptlim))
return (0);
continue;
+ case 'F':
+ if (!_fmt("%Y-%m-%d", t, pt, ptlim))
+ return (0);
+ continue;
case 'H':
if (!_conv(t->tm_hour, 2, '0', pt, ptlim))
return (0);
Home |
Main Index |
Thread Index |
Old Index