mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Bring in a patch from Keith Parks to move the use of European dates
from a #define to a run-time option '-e' Man page was updated to reflect new option
This commit is contained in:
@ -19,6 +19,8 @@
|
||||
#include <time.h>
|
||||
|
||||
#include <config.h>
|
||||
#include <postgres.h>
|
||||
#include <miscadmin.h>
|
||||
#include <parser/sysfunc.h>
|
||||
|
||||
/*
|
||||
@ -33,13 +35,13 @@ static char *Sysfunc_system_date(void)
|
||||
|
||||
time(&cur_time_secs);
|
||||
cur_time_expanded = localtime(&cur_time_secs);
|
||||
#if defined(EUROPEAN_DATES)
|
||||
sprintf(buf, "%2.2d-%2.2d-%4.4d", cur_time_expanded->tm_mday,
|
||||
if (EuroDates == 1)
|
||||
sprintf(buf, "%2.2d-%2.2d-%4.4d", cur_time_expanded->tm_mday,
|
||||
cur_time_expanded->tm_mon+1, cur_time_expanded->tm_year+1900);
|
||||
#else
|
||||
sprintf(buf, "%2.2d-%2.2d-%4.4d", cur_time_expanded->tm_mon+1,
|
||||
else
|
||||
sprintf(buf, "%2.2d-%2.2d-%4.4d", cur_time_expanded->tm_mon+1,
|
||||
cur_time_expanded->tm_mday, cur_time_expanded->tm_year+1900);
|
||||
#endif
|
||||
|
||||
return &buf[0];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user