mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +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:
@@ -15,7 +15,7 @@
|
||||
* 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>
|
||||
|
||||
@@ -408,5 +408,5 @@ isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len) {
|
||||
snprintf(buf + flen, len - flen,
|
||||
".%03u", t->nanoseconds / 1000000);
|
||||
else
|
||||
snprintf(buf, len, "Bad 00 99:99:99.999");
|
||||
snprintf(buf, len, "99-Bad-9999 99:99:99.999");
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* 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
|
||||
#define ISC_TIME_H 1
|
||||
@@ -234,7 +234,7 @@ void
|
||||
isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int 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,
|
||||
* but is always guaranteed to be null terminated.
|
||||
*
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* 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>
|
||||
|
||||
@@ -220,12 +220,12 @@ isc_time_formattimestamp(const isc_time_t *t, char *buf, unsigned int len) {
|
||||
char DateBuf[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);
|
||||
if (FileTimeToLocalFileTime(&t->absolute, &localft) &&
|
||||
FileTimeToSystemTime(&localft, &st)) {
|
||||
GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, "MMM d", DateBuf,
|
||||
GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, "dd-MMM-yyyy", DateBuf,
|
||||
50);
|
||||
GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOTIMEMARKER|
|
||||
TIME_FORCE24HOURFORMAT, &st, NULL, TimeBuf, 50);
|
||||
|
Reference in New Issue
Block a user