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
87581343
Commit
87581343
authored
May 21, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove excess parens, use Abs instead of : ?.
parent
2e9c04ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
src/backend/utils/adt/datetime.c
src/backend/utils/adt/datetime.c
+8
-8
No files found.
src/backend/utils/adt/datetime.c
View file @
87581343
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.1
39 2005/04/20 17:14:50 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.1
40 2005/05/21 03:38:05 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1551,7 +1551,7 @@ DecodeDateTime(char **field, int *ftype, int nf,
return
DTERR_FIELD_OVERFLOW
;
/* timezone not specified? then find local timezone if possible */
if
(
(
tzp
!=
NULL
)
&&
(
!
(
fmask
&
DTK_M
(
TZ
)
)))
if
(
tzp
!=
NULL
&&
!
(
fmask
&
DTK_M
(
TZ
)))
{
/*
* daylight savings time modifier but no standard timezone?
...
...
@@ -2205,7 +2205,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf,
return
DTERR_BAD_FORMAT
;
/* timezone not specified? then find local timezone if possible */
if
(
(
tzp
!=
NULL
)
&&
(
!
(
fmask
&
DTK_M
(
TZ
)
)))
if
(
tzp
!=
NULL
&&
!
(
fmask
&
DTK_M
(
TZ
)))
{
struct
pg_tm
tt
,
*
tmp
=
&
tt
;
...
...
@@ -3533,7 +3533,7 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style,
* have alpha time zone info available. tm_isdst != -1
* indicates that we have a valid time zone translation.
*/
if
(
(
tzp
!=
NULL
)
&&
(
tm
->
tm_isdst
>=
0
)
)
if
(
tzp
!=
NULL
&&
tm
->
tm_isdst
>=
0
)
{
hour
=
-
(
*
tzp
/
3600
);
min
=
((
abs
(
*
tzp
)
/
60
)
%
60
);
...
...
@@ -3579,7 +3579,7 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style,
else
sprintf
((
str
+
strlen
(
str
)),
":%02d"
,
tm
->
tm_sec
);
if
(
(
tzp
!=
NULL
)
&&
(
tm
->
tm_isdst
>=
0
)
)
if
(
tzp
!=
NULL
&&
tm
->
tm_isdst
>=
0
)
{
if
(
*
tzn
!=
NULL
)
sprintf
((
str
+
strlen
(
str
)),
" %.*s"
,
MAXTZLEN
,
*
tzn
);
...
...
@@ -3627,7 +3627,7 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style,
else
sprintf
((
str
+
strlen
(
str
)),
":%02d"
,
tm
->
tm_sec
);
if
(
(
tzp
!=
NULL
)
&&
(
tm
->
tm_isdst
>=
0
)
)
if
(
tzp
!=
NULL
&&
tm
->
tm_isdst
>=
0
)
{
if
(
*
tzn
!=
NULL
)
sprintf
((
str
+
strlen
(
str
)),
" %.*s"
,
MAXTZLEN
,
*
tzn
);
...
...
@@ -3686,7 +3686,7 @@ EncodeDateTime(struct pg_tm * tm, fsec_t fsec, int *tzp, char **tzn, int style,
sprintf
((
str
+
strlen
(
str
)),
" %04d"
,
((
tm
->
tm_year
>
0
)
?
tm
->
tm_year
:
-
(
tm
->
tm_year
-
1
)));
if
(
(
tzp
!=
NULL
)
&&
(
tm
->
tm_isdst
>=
0
)
)
if
(
tzp
!=
NULL
&&
tm
->
tm_isdst
>=
0
)
{
if
(
*
tzn
!=
NULL
)
sprintf
((
str
+
strlen
(
str
)),
" %.*s"
,
MAXTZLEN
,
*
tzn
);
...
...
@@ -3787,7 +3787,7 @@ EncodeInterval(struct pg_tm * tm, fsec_t fsec, int style, char *str)
#ifdef HAVE_INT64_TIMESTAMP
sprintf
(
cp
,
":%02d"
,
abs
(
tm
->
tm_sec
));
cp
+=
strlen
(
cp
);
sprintf
(
cp
,
".%06d"
,
((
fsec
>=
0
)
?
fsec
:
-
(
fsec
)
));
sprintf
(
cp
,
".%06d"
,
Abs
(
fsec
));
#else
fsec
+=
tm
->
tm_sec
;
sprintf
(
cp
,
":%013.10f"
,
fabs
(
fsec
));
...
...
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