Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
8fe55efd
Commit
8fe55efd
authored
27 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
Support special values 'now', 'current', etc on output.
parent
f54cc390
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/utils/adt/timestamp.c
+25
-23
25 additions, 23 deletions
src/backend/utils/adt/timestamp.c
with
25 additions
and
23 deletions
src/backend/utils/adt/timestamp.c
+
25
−
23
View file @
8fe55efd
...
...
@@ -29,13 +29,33 @@ timestamp_out(time_t timestamp)
char
zone
[
MAXDATELEN
+
1
],
*
tzn
=
zone
;
abstime2tm
(
timestamp
,
&
tz
,
tm
,
tzn
);
EncodeDateTime
(
tm
,
fsec
,
&
tz
,
&
tzn
,
USE_ISO_DATES
,
buf
);
switch
(
timestamp
)
{
case
EPOCH_ABSTIME
:
strcpy
(
buf
,
EPOCH
);
break
;
case
INVALID_ABSTIME
:
strcpy
(
buf
,
INVALID
);
break
;
case
CURRENT_ABSTIME
:
strcpy
(
buf
,
DCURRENT
);
break
;
case
NOEND_ABSTIME
:
strcpy
(
buf
,
LATE
);
break
;
case
NOSTART_ABSTIME
:
strcpy
(
buf
,
EARLY
);
break
;
default:
abstime2tm
(
timestamp
,
&
tz
,
tm
,
tzn
);
EncodeDateTime
(
tm
,
fsec
,
&
tz
,
&
tzn
,
USE_ISO_DATES
,
buf
);
break
;
}
result
=
palloc
(
strlen
(
buf
)
+
1
);
strcpy
(
result
,
buf
);
return
result
;
}
}
/* timestamp_out() */
time_t
now
(
void
)
...
...
@@ -49,58 +69,40 @@ now(void)
bool
timestampeq
(
time_t
t1
,
time_t
t2
)
{
#if FALSE
return
(
t1
==
t2
);
#endif
return
(
abstimeeq
(
t1
,
t2
));
}
bool
timestampne
(
time_t
t1
,
time_t
t2
)
{
#if FALSE
return
(
t1
!=
t2
);
#endif
return
(
abstimene
(
t1
,
t2
));
}
bool
timestamplt
(
time_t
t1
,
time_t
t2
)
{
#if FALSE
return
(
t1
>
t2
);
#endif
return
(
abstimelt
(
t1
,
t2
));
}
bool
timestampgt
(
time_t
t1
,
time_t
t2
)
{
#if FALSE
return
(
t1
<
t2
);
#endif
return
(
abstimegt
(
t1
,
t2
));
}
bool
timestample
(
time_t
t1
,
time_t
t2
)
{
#if FALSE
return
(
t1
>=
t2
);
#endif
return
(
abstimele
(
t1
,
t2
));
}
bool
timestampge
(
time_t
t1
,
time_t
t2
)
{
#if FALSE
return
(
t1
<=
t2
);
#endif
return
(
abstimege
(
t1
,
t2
));
}
DateTime
*
DateTime
*
timestamp_datetime
(
time_t
timestamp
)
{
DateTime
*
result
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment