[27455] in CVS-changelog-for-Kerberos-V5
krb5 commit: Add more formats to krb5_timestamp_to_sfstring
daemon@ATHENA.MIT.EDU (Tom Yu)
Sat Dec 22 12:47:13 2012
Date: Sat, 22 Dec 2012 12:47:11 -0500
From: Tom Yu <tlyu@mit.edu>
Message-Id: <201212221747.qBMHlBhg019933@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu
https://github.com/krb5/krb5/commit/e8e34ead59b3e1fd28beb151c5e6efb47bc57bee
commit e8e34ead59b3e1fd28beb151c5e6efb47bc57bee
Author: Tom Yu <tlyu@mit.edu>
Date: Fri Dec 21 15:45:53 2012 -0500
Add more formats to krb5_timestamp_to_sfstring
krb5_timestamp_to_string() can produce ambiguous dates. The final
fallback, "%d/%m/%Y %R", contains a European order date format that
can be confused with a US date format. Add some additional strftime()
format strings, including locale-dependent formats and some ISO 8601
formats. Remove the hardcoded strftime() format that had an ambiguous
date order.
ticket: 7458
target_version: 1.11
tags: pullup
src/lib/krb5/krb/str_conv.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/lib/krb5/krb/str_conv.c b/src/lib/krb5/krb/str_conv.c
index e39cd66..1ffd026 100644
--- a/src/lib/krb5/krb/str_conv.c
+++ b/src/lib/krb5/krb/str_conv.c
@@ -239,7 +239,12 @@ krb5_timestamp_to_sfstring(krb5_timestamp timestamp, char *buffer, size_t buflen
"%c", /* Default locale-dependent date and time */
"%d %b %Y %T", /* dd mon yyyy hh:mm:ss */
"%x %X", /* locale-dependent short format */
- "%d/%m/%Y %R" /* dd/mm/yyyy hh:mm */
+ "%x %T", /* locale-dependent date + hh:mm:ss */
+ "%x %R", /* locale-dependent date + hh:mm */
+ "%Y-%m-%dT%H:%M:%S", /* ISO 8601 date + time */
+ "%Y-%m-%dT%H:%M", /* ISO 8601 date + hh:mm */
+ "%Y%m%d%H%M%S", /* ISO 8601 date + time, basic */
+ "%Y%m%d%H%M" /* ISO 8601 date + hh:mm, basic */
};
static const unsigned int sftime_format_table_nents =
sizeof(sftime_format_table)/sizeof(sftime_format_table[0]);
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5