Go to the source code of this file.
◆ __DCL_PG_TYPES_H__
| #define __DCL_PG_TYPES_H__ 20250406 |
◆ __decode() [1/4]
| void __decode |
( |
const char * | _s, |
|
|
SQL::Time * | _r ) |
Definition at line 49 of file PgTypes.cpp.
50{
51 int h, m, s, f;
52 (void) sscanf(_s, __TIME_FORMAT, &h, &m, &s, &f);
58}
◆ __decode() [2/4]
| __DCL_BEGIN_NAMESPACE void __decode |
( |
const date * | _s, |
|
|
SQL::Date * | _r ) |
Definition at line 27 of file PgTypes.cpp.
28{
29 int mdy[3];
30 PGTYPESdate_julmdy(*_s, mdy);
33 _r->year = mdy[2] - (*_s < 730119 ? 1 : 0);
34
35}
◆ __decode() [3/4]
Definition at line 111 of file PgTypes.cpp.
112{
113
114 _r->years = _s->month / 12;
115 _r->months = _s->month % 12;
116
117 _r->fracs = (_s->time % 1000000) * 1000;
118 int64_t t = _s->time / 1000000;
120 t /= 60;
122 t /= 60;
124 _r->days = (int) (t / 24);
125}
◆ __decode() [4/4]
Definition at line 66 of file PgTypes.cpp.
67{
68
69 char sz[40];
70 int r = PGTYPEStimestamp_fmt_asc((timestamp*) _s, sz,
sizeof(sz),
71 "%Y-%m-%d %H:%M:%S %z");
72
73 int Y, m, d,
H, M, S, tzhour, tzmin;
74 (void) sscanf(sz, "%d-%02u-%02u %02u:%02u:%02u %3d%02u",
75 &Y, &m, &d, &
H, &M, &S, &tzhour, &tzmin);
76 _r->year = Y - (*_s < -63082281600000000LL ? 1 : 0);
84
85
86}
◆ __encode() [1/4]
| void __encode |
( |
const SQL::Date * | _s, |
|
|
date * | _r ) |
Definition at line 37 of file PgTypes.cpp.
38{
39 int mdy[3];
43 PGTYPESdate_mdyjul(mdy,
_r);
44}
◆ __encode() [2/4]
Definition at line 127 of file PgTypes.cpp.
128{
129
130
131
133 _r->time = (_s->
fracs / 1000LL)
134 + (_s->
secs * 1000000LL)
135 + (_s->
mins * 60 * 1000000LL)
136 + (_s->
hours * 60 * 60 * 1000000LL)
137 + (_s->
days * 24 * 60 * 60 * 1000000LL)
138 ;
139}
◆ __encode() [3/4]
Definition at line 60 of file PgTypes.cpp.
61{
62 return ByteString::format(__TIME_FORMAT,
64}
◆ __encode() [4/4]
Definition at line 93 of file PgTypes.cpp.
94{
95
96
97
98
99
100 char sz[40];
102 sz, sizeof(sz), "%04d-%02u-%02u %02u:%02u:%02u",
105 );
106
107
108 PGTYPEStimestamp_defmt_asc(sz,
"%Y-%m-%d %H:%M:%S",
_r);
109}
void CharsetConvertException *size_t n