Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ec86e4b9
Commit
ec86e4b9
authored
Oct 25, 1996
by
Bryan Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use EUROPEAN_DATES instead of EUROPEAN_STYLE
parent
3010f46d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
src/backend/utils/adt/datetimes.c
src/backend/utils/adt/datetimes.c
+8
-11
No files found.
src/backend/utils/adt/datetimes.c
View file @
ec86e4b9
...
@@ -7,17 +7,17 @@
...
@@ -7,17 +7,17 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/datetimes.c,v 1.
3 1996/08/27 07:32:30 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/datetimes.c,v 1.
4 1996/10/25 06:02:52 bryanh
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#include "config.h"
#include <stdio.h>
/* for sprintf() */
#include <stdio.h>
/* for sprintf() */
#include <string.h>
#include <string.h>
#include "postgres.h"
#include "utils/palloc.h"
#include <config.h>
#include "utils/elog.h"
#include <postgres.h>
#include <utils/palloc.h>
#include <utils/elog.h>
/* these things look like structs, but we pass them by value so be careful
/* these things look like structs, but we pass them by value so be careful
For example, passing an int -> DateADT is not portable! */
For example, passing an int -> DateADT is not portable! */
...
@@ -33,9 +33,6 @@ typedef struct TimeADT {
...
@@ -33,9 +33,6 @@ typedef struct TimeADT {
float
sec
;
float
sec
;
}
TimeADT
;
}
TimeADT
;
#ifndef EUROPEAN_STYLE
#define AMERICAN_STYLE
#endif
static
int
day_tab
[
2
][
12
]
=
{
static
int
day_tab
[
2
][
12
]
=
{
{
31
,
28
,
31
,
30
,
31
,
30
,
31
,
31
,
30
,
31
,
30
,
31
},
{
31
,
28
,
31
,
30
,
31
,
30
,
31
,
31
,
30
,
31
,
30
,
31
},
...
@@ -69,7 +66,7 @@ date_in(char *datestr)
...
@@ -69,7 +66,7 @@ date_in(char *datestr)
# define CHECK_DATE_LEN(datestr) 1
# define CHECK_DATE_LEN(datestr) 1
#endif
#endif
#if
def AMERICAN_STYLE
#if
ndef EUROPEAN_DATES
if
(
!
CHECK_DATE_LEN
(
datestr
)
||
if
(
!
CHECK_DATE_LEN
(
datestr
)
||
sscanf
(
datestr
,
"%d%*c%d%*c%d"
,
&
m
,
&
d
,
&
y
)
!=
3
)
{
sscanf
(
datestr
,
"%d%*c%d%*c%d"
,
&
m
,
&
d
,
&
y
)
!=
3
)
{
elog
(
WARN
,
"date_in: date
\"
%s
\"
not of the form mm-dd-yyyy"
,
elog
(
WARN
,
"date_in: date
\"
%s
\"
not of the form mm-dd-yyyy"
,
...
@@ -113,7 +110,7 @@ date_out(int4 dateVal)
...
@@ -113,7 +110,7 @@ date_out(int4 dateVal)
date
=
(
DateADT
*
)
&
dateStore
;
date
=
(
DateADT
*
)
&
dateStore
;
dateStore
=
dateVal
;
dateStore
=
dateVal
;
#if
def AMERICAN_STYLE
#if
ndef EUROPEAN_DATES
sprintf
(
datestr
,
"%02d-%02d-%04d"
,
sprintf
(
datestr
,
"%02d-%02d-%04d"
,
(
int
)
date
->
month
,
(
int
)
date
->
day
,
(
int
)
date
->
year
);
(
int
)
date
->
month
,
(
int
)
date
->
day
,
(
int
)
date
->
year
);
#else
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment