2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 22:45:39 +00:00

Update isc_time_formattimestamp to use the 12-Dec-2001 style of datestamp. Fix badtime to be 99-Bad-9999

This commit is contained in:
Danny Mayer
2001-12-19 03:46:57 +00:00
parent 66291de206
commit 13f20ab1fa
3 changed files with 7 additions and 7 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: time.c,v 1.44 2001/12/17 02:55:05 marka Exp $ */ /* $Id: time.c,v 1.45 2001/12/19 03:46:52 mayer Exp $ */
#include <config.h> #include <config.h>
@@ -408,5 +408,5 @@ isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len) {
snprintf(buf + flen, len - flen, snprintf(buf + flen, len - flen,
".%03u", t->nanoseconds / 1000000); ".%03u", t->nanoseconds / 1000000);
else else
snprintf(buf, len, "Bad 00 99:99:99.999"); snprintf(buf, len, "99-Bad-9999 99:99:99.999");
} }

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: time.h,v 1.24 2001/11/19 03:08:32 mayer Exp $ */ /* $Id: time.h,v 1.25 2001/12/19 03:46:57 mayer Exp $ */
#ifndef ISC_TIME_H #ifndef ISC_TIME_H
#define ISC_TIME_H 1 #define ISC_TIME_H 1
@@ -234,7 +234,7 @@ void
isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len); isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len);
/* /*
* Format the time 't' into the buffer 'buf' of length 'len', * Format the time 't' into the buffer 'buf' of length 'len',
* using a format like "Aug 30 04:06:47.997" and the local time zone. * using a format like "30-Aug-2000 04:06:47.997" and the local time zone.
* If the text does not fit in the buffer, the result is indeterminate, * If the text does not fit in the buffer, the result is indeterminate,
* but is always guaranteed to be null terminated. * but is always guaranteed to be null terminated.
* *

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: time.c,v 1.34 2001/11/19 03:08:28 mayer Exp $ */ /* $Id: time.c,v 1.35 2001/12/19 03:46:55 mayer Exp $ */
#include <config.h> #include <config.h>
@@ -220,12 +220,12 @@ isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len) {
char DateBuf[50]; char DateBuf[50];
char TimeBuf[50]; char TimeBuf[50];
static const char badtime[] = "Bad 00 99:99:99.999"; static const char badtime[] = "99-Bad-9999 99:99:99.999";
REQUIRE(len > 0); REQUIRE(len > 0);
if (FileTimeToLocalFileTime(&t->absolute, &localft) && if (FileTimeToLocalFileTime(&t->absolute, &localft) &&
FileTimeToSystemTime(&localft, &st)) { FileTimeToSystemTime(&localft, &st)) {
GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, "MMM d", DateBuf, GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, "dd-MMM-yyyy", DateBuf,
50); 50);
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOTIMEMARKER| GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOTIMEMARKER|
TIME_FORCE24HOURFORMAT, &st, NULL, TimeBuf, 50); TIME_FORCE24HOURFORMAT, &st, NULL, TimeBuf, 50);