Skip to content

Commit f340ee8

Browse files
committed
Fixed a bug for parsing posix timezone: the + sign must be used for timezones on the west of UTC, and - for timezones on the east of UTC correspondingly.
Fixes: * https://svn.boost.org/trac/boost/ticket/4545 * https://svn.boost.org/trac/boost/ticket/3336
1 parent d7673dd commit f340ee8

17 files changed

Lines changed: 114 additions & 114 deletions

include/boost/date_time/local_time/custom_time_zone.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ namespace local_time {
106106
// offset
107107
if(base_utc_offset().is_negative()) {
108108
// inverting the sign guarantees we get two digits
109-
ss << '-' << std::setw(2) << base_utc_offset().invert_sign().hours();
109+
ss << '+' << std::setw(2) << base_utc_offset().invert_sign().hours();
110110
}
111111
else {
112-
ss << '+' << std::setw(2) << base_utc_offset().hours();
112+
ss << '-' << std::setw(2) << base_utc_offset().hours();
113113
}
114114
if(base_utc_offset().minutes() != 0 || base_utc_offset().seconds() != 0) {
115115
ss << ':' << std::setw(2) << base_utc_offset().minutes();

include/boost/date_time/local_time/posix_time_zone.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ namespace local_time{
190190
// offset
191191
if(base_utc_offset().is_negative()) {
192192
// inverting the sign guarantees we get two digits
193-
ss << '-' << std::setw(2) << base_utc_offset().invert_sign().hours();
193+
ss << '+' << std::setw(2) << base_utc_offset().invert_sign().hours();
194194
}
195195
else {
196-
ss << '+' << std::setw(2) << base_utc_offset().hours();
196+
ss << '-' << std::setw(2) << base_utc_offset().hours();
197197
}
198198
if(base_utc_offset().minutes() != 0 || base_utc_offset().seconds() != 0) {
199199
ss << ':' << std::setw(2) << base_utc_offset().minutes();
@@ -266,7 +266,7 @@ namespace local_time{
266266
while(sit != obj_end && !std::isalpha(*sit)){
267267
ss << *sit++;
268268
}
269-
base_utc_offset_ = date_time::str_from_delimited_time_duration<time_duration_type,char_type>(ss.str());
269+
base_utc_offset_ = date_time::str_from_delimited_time_duration<time_duration_type,char_type>(ss.str()).invert_sign();
270270
ss.str(empty_string);
271271

272272
// base offset must be within range of -12 hours to +14 hours

test/local_time/testclocks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ main()
1919
using namespace boost::local_time;
2020

2121

22-
boost::shared_ptr<time_zone> az_tz(new posix_time_zone("MST-07"));
23-
boost::shared_ptr<time_zone> ny_tz(new posix_time_zone("EST-05EDT,M4.1.0,M10.5.0"));
22+
boost::shared_ptr<time_zone> az_tz(new posix_time_zone("MST+07"));
23+
boost::shared_ptr<time_zone> ny_tz(new posix_time_zone("EST+05EDT,M4.1.0,M10.5.0"));
2424

2525
ptime tl = second_clock::local_time();
2626
std::cout << to_simple_string(tl) << std::endl;

test/local_time/testcustom_time_zone.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ main()
6666
tz1->dst_local_end_time(2003) == ptime(date(2003,Oct,30),hours(2)));
6767

6868
check("tz1 to posix string",
69-
tz1->to_posix_string() == std::string("PST-08PDT+01,120/02:00,303/02:00"));
69+
tz1->to_posix_string() == std::string("PST+08PDT+01,120/02:00,303/02:00"));
7070
check("tz2 to posix string",
71-
tz2->to_posix_string() == std::string("PST-08PDT+01,M4.1.0/02:00,M10.5.0/02:00"));
71+
tz2->to_posix_string() == std::string("PST+08PDT+01,M4.1.0/02:00,M10.5.0/02:00"));
7272
check("tz3 to posix string",
73-
tz3->to_posix_string() == std::string("PST-08PDT+01,M3.5.0/02:00,M10.5.0/02:00"));
73+
tz3->to_posix_string() == std::string("PST+08PDT+01,M3.5.0/02:00,M10.5.0/02:00"));
7474
check("tz4 to posix string",
75-
tz4->to_posix_string() == std::string("MST-07"));
75+
tz4->to_posix_string() == std::string("MST+07"));
7676

7777
// test start/end for non-dst zone
7878
check("has dst in non-dst zone", !tz4->has_dst());

test/local_time/testlocal_time.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ main()
4949
// of these operations is done in the posix_time tests
5050

5151
try {
52-
time_zone_ptr az_tz(new posix_time_zone("MST-07"));
53-
time_zone_ptr ny_tz(new posix_time_zone("EST-05EDT,M4.1.0,M10.5.0"));
52+
time_zone_ptr az_tz(new posix_time_zone("MST+07"));
53+
time_zone_ptr ny_tz(new posix_time_zone("EST+05EDT,M4.1.0,M10.5.0"));
5454
// EST & EST for sydney is correct, according to zoneinfo files
55-
time_zone_ptr sydney(new posix_time_zone("EST+10EST,M10.5.0,M3.5.0/03:00"));
55+
time_zone_ptr sydney(new posix_time_zone("EST-10EST,M10.5.0,M3.5.0/03:00"));
5656
time_zone_ptr null_tz;
5757
date d(2003, 12, 20);
5858
hours h(12);

test/local_time/testlocal_time_input_facet.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int main() {
7171
#if !defined(BOOST_NO_STD_WSTRING)
7272
{
7373
std::wstringstream ws;
74-
ws.str(L"2005-Feb-15 12:15:00 EST-05EDT,M4.1.0,M10.5.0");
74+
ws.str(L"2005-Feb-15 12:15:00 EST+05EDT,M4.1.0,M10.5.0");
7575
ws >> ldt1;
7676
check("Wide stream, Eastern US, daylight savings, winter, minimal input",
7777
ldt1.local_time() == ptime(date(2005,2,15), time_duration(12,15,0)));
@@ -82,7 +82,7 @@ int main() {
8282
wlocal_time_input_facet* wfacet = new wlocal_time_input_facet(L"%m/%d/%y %ZP");
8383
std::locale loc(std::locale::classic(), wfacet);
8484
ws.imbue(loc);
85-
ws.str(L"10/31/04 PST-08PDT,M4.1.0,M10.5.0"); // midnight on end transition day, still in dst
85+
ws.str(L"10/31/04 PST+08PDT,M4.1.0,M10.5.0"); // midnight on end transition day, still in dst
8686
ws >> ldt1;
8787
std::wcout << ldt1.local_time() << std::endl;
8888
check("Wide stream, Eastern US, daylight savings, winter, custom format",
@@ -94,7 +94,7 @@ int main() {
9494
#endif // BOOST_NO_STD_WSTRING
9595

9696
std::stringstream ss;
97-
ss.str("2005-Feb-25 12:15:00 EST-05EDT,M4.1.0,M10.5.0");
97+
ss.str("2005-Feb-25 12:15:00 EST+05EDT,M4.1.0,M10.5.0");
9898
ss >> ldt1;
9999
check("Eastern US, daylight savings, winter, minimal input",
100100
ldt1.local_time() == ptime(date(2005,2,25), time_duration(12,15,0)));
@@ -103,7 +103,7 @@ int main() {
103103
check("Eastern US, daylight savings, winter, minimal input", !ldt1.is_dst());
104104
ss.str("");
105105

106-
ss.str("2005-Aug-25 12:15:00 EST-05EDT,M4.1.0,M10.5.0");
106+
ss.str("2005-Aug-25 12:15:00 EST+05EDT,M4.1.0,M10.5.0");
107107
ss >> ldt1;
108108
check("Eastern US, daylight savings, summer, minimal input",
109109
ldt1.local_time() == ptime(date(2005,8,25), time_duration(12,15,0)));
@@ -112,28 +112,28 @@ int main() {
112112
check("Eastern US, daylight savings, summer, minimal input", ldt1.is_dst());
113113
ss.str("");
114114

115-
ss.str("2005-Apr-03 01:15:00 EST-05EDT,M4.1.0,M10.5.0");
115+
ss.str("2005-Apr-03 01:15:00 EST+05EDT,M4.1.0,M10.5.0");
116116
ss >> ldt1;
117117
check("Eastern US, daylight savings, transition point", !ldt1.is_dst());
118118
ldt1 += hours(1);
119119
check("Eastern US, daylight savings, transition point", ldt1.is_dst());
120120
ss.str("");
121-
ss.str("2005-Apr-03 01:15:00 EST-05EDT,93,303");
121+
ss.str("2005-Apr-03 01:15:00 EST+05EDT,93,303");
122122
ss >> ldt1;
123123
check("Eastern US, daylight savings, transition point", !ldt1.is_dst());
124124
ldt1 += hours(1);
125125
check("Eastern US, daylight savings, transition point", ldt1.is_dst());
126126
ss.str("");
127127

128-
ss.str("2005-Oct-30 00:15:00 EST-05EDT,M4.1.0,M10.5.0");
128+
ss.str("2005-Oct-30 00:15:00 EST+05EDT,M4.1.0,M10.5.0");
129129
ss >> ldt1;
130130
check("Eastern US, daylight savings, transition point", ldt1.is_dst());
131131
ldt1 += hours(1);
132132
check("Eastern US, daylight savings, transition point", ldt1.is_dst());
133133
ldt1 += hours(1);
134134
check("Eastern US, daylight savings, transition point", !ldt1.is_dst());
135135
ss.str("");
136-
ss.str("2005-Oct-30 00:15:00 EST-05EDT,93,303");
136+
ss.str("2005-Oct-30 00:15:00 EST+05EDT,93,303");
137137
ss >> ldt1;
138138
check("Eastern US, daylight savings, transition point", ldt1.is_dst());
139139
ldt1 += hours(1);
@@ -142,7 +142,7 @@ int main() {
142142
check("Eastern US, daylight savings, transition point", !ldt1.is_dst());
143143
ss.str("");
144144

145-
ss.str("2005-Aug-25 12:15:00 MST-07");
145+
ss.str("2005-Aug-25 12:15:00 MST+07");
146146
ss >> ldt1;
147147
check("Mountain US, no daylight savings",
148148
ldt1.local_time() == ptime(date(2005,8,25), time_duration(12,15,0)));
@@ -156,7 +156,7 @@ int main() {
156156
new local_time_facet(local_time_input_facet::default_time_input_format);
157157
std::locale loc(std::locale::classic(), out_facet);
158158
ss.imbue(loc);
159-
time_zone_ptr syd_tz(new posix_time_zone("EST+10EST,M10.5.0,M3.5.0/03:00"));
159+
time_zone_ptr syd_tz(new posix_time_zone("EST-10EST,M10.5.0,M3.5.0/03:00"));
160160
ptime pt(date(2005,6,12), hours(0));
161161
local_date_time ldt2(pt, syd_tz);
162162
ss << ldt2;
@@ -166,7 +166,7 @@ int main() {
166166
ldt1.zone()->dst_local_start_time(2004) == ldt2.zone()->dst_local_start_time(2004));
167167
ss.str("");
168168

169-
time_zone_ptr f_tz(new posix_time_zone("FST+03FDT,90,300"));
169+
time_zone_ptr f_tz(new posix_time_zone("FST-03FDT,90,300"));
170170
ldt2 = local_date_time(ptime(date(2005,6,12), hours(0)), f_tz);
171171
ss << ldt2;
172172
ss >> ldt1;
@@ -182,7 +182,7 @@ int main() {
182182
check("Missing time_zone spec makes UTC", ldt1.utc_time() == ldt1.local_time());
183183
ss.str("");
184184
{
185-
std::istringstream iss("2005-Aug-25 12:15:00 MST-07");
185+
std::istringstream iss("2005-Aug-25 12:15:00 MST+07");
186186
local_time_input_facet* f = new local_time_input_facet("%Y-%b-%d %H:%M:%S %z");
187187
std::locale loc(std::locale::classic(), f);
188188
iss.imbue(loc);
@@ -199,39 +199,39 @@ int main() {
199199
time_label_invalid inv_ex("default");
200200
check("Failure test ambiguous time label (w/exceptions)",
201201
failure_test(ldt1,
202-
"2005-Oct-30 01:15:00 EST-05EDT,M4.1.0,M10.5.0",
202+
"2005-Oct-30 01:15:00 EST+05EDT,M4.1.0,M10.5.0",
203203
amb_ex,
204204
new local_time_input_facet()));
205205
check("Failure test ambiguous time label (no exceptions)",
206206
failure_test(ldt1,
207-
"2005-Oct-30 01:15:00 EST-05EDT,M4.1.0,M10.5.0",
207+
"2005-Oct-30 01:15:00 EST+05EDT,M4.1.0,M10.5.0",
208208
new local_time_input_facet()));
209209
check("Failure test ambiguous time label (w/exceptions)",
210210
failure_test(ldt1,
211-
"2005-Oct-30 01:15:00 EST-05EDT,93,303",
211+
"2005-Oct-30 01:15:00 EST+05EDT,93,303",
212212
amb_ex,
213213
new local_time_input_facet()));
214214
check("Failure test ambiguous time label (no exceptions)",
215215
failure_test(ldt1,
216-
"2005-Oct-30 01:15:00 EST-05EDT,93,303",
216+
"2005-Oct-30 01:15:00 EST+05EDT,93,303",
217217
new local_time_input_facet()));
218218
check("Failure test invalid time label (w/exceptions)",
219219
failure_test(ldt1,
220-
"2005-Apr-03 02:15:00 EST-05EDT,M4.1.0,M10.5.0",
220+
"2005-Apr-03 02:15:00 EST+05EDT,M4.1.0,M10.5.0",
221221
inv_ex,
222222
new local_time_input_facet()));
223223
check("Failure test invalid time label (no exceptions)",
224224
failure_test(ldt1,
225-
"2005-Apr-03 02:15:00 EST-05EDT,M4.1.0,M10.5.0",
225+
"2005-Apr-03 02:15:00 EST+05EDT,M4.1.0,M10.5.0",
226226
new local_time_input_facet()));
227227
check("Failure test invalid time label (w/exceptions)",
228228
failure_test(ldt1,
229-
"2005-Apr-03 02:15:00 EST-05EDT,93,303",
229+
"2005-Apr-03 02:15:00 EST+05EDT,93,303",
230230
inv_ex,
231231
new local_time_input_facet()));
232232
check("Failure test invalid time label (no exceptions)",
233233
failure_test(ldt1,
234-
"2005-Apr-03 02:15:00 EST-05EDT,93,303",
234+
"2005-Apr-03 02:15:00 EST+05EDT,93,303",
235235
new local_time_input_facet()));
236236

237237

test/local_time/testlocal_time_iterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int
4141
main()
4242
{
4343

44-
time_zone_ptr ny_tz(new posix_time_zone("EST-05EDT,M4.1.0,M10.5.0"));
44+
time_zone_ptr ny_tz(new posix_time_zone("EST+05EDT,M4.1.0,M10.5.0"));
4545

4646
//set up a time right on the dst boundary -- iterator will
4747
//jump forward an hour at the boundary

test/local_time/testlocal_time_period.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ int main()
1515
using namespace boost::local_time;
1616
date d1(2001,Jan, 1);
1717

18-
time_zone_ptr az_tz(new posix_time_zone("MST-07"));
18+
time_zone_ptr az_tz(new posix_time_zone("MST+07"));
1919

2020
local_date_time t1 (d1,hours(2), az_tz, false);//2001-Jan-1 02:00:00
2121

test/local_time/testposix_time_zone.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int main(){
1919
using namespace boost::local_time;
2020
using namespace boost::posix_time;
2121
using namespace boost::gregorian;
22-
std::string specs[] = {"MST-07", "MST-07:00:00","EST-05EDT,M4.1.0,M10.5.0", "EST-05:00:00EDT+01:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00","PST-08PDT,J46/1:30,J310","PST-08PDT,45,310/0:30:00"};
22+
std::string specs[] = {"MST+07", "MST+07:00:00","EST+05EDT,M4.1.0,M10.5.0", "EST+05:00:00EDT+01:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00","PST+08PDT,J46/1:30,J310","PST+08PDT,45,310/0:30:00"};
2323

2424
posix_time_zone nyc1(specs[2]);
2525
posix_time_zone nyc2(specs[3]);
@@ -49,9 +49,9 @@ int main(){
4949
check("dst ends match", nyc1.dst_local_end_time(2003) ==
5050
nyc2.dst_local_end_time(2003));
5151
check("to posix string",
52-
nyc1.to_posix_string() == std::string("EST-05EDT+01,M4.1.0/02:00,M10.5.0/02:00"));
52+
nyc1.to_posix_string() == std::string("EST+05EDT+01,M4.1.0/02:00,M10.5.0/02:00"));
5353
check("to posix string",
54-
nyc2.to_posix_string() == std::string("EST-05EDT+01,M4.1.0/02:00,M10.5.0/02:00"));
54+
nyc2.to_posix_string() == std::string("EST+05EDT+01,M4.1.0/02:00,M10.5.0/02:00"));
5555

5656

5757
posix_time_zone az1(specs[0]);
@@ -75,14 +75,14 @@ int main(){
7575
check("Names", az1.dst_zone_name() == std::string(""));
7676
check("Names", az2.dst_zone_name() == std::string(""));
7777
check("to posix string",
78-
az1.to_posix_string() == std::string("MST-07"));
78+
az1.to_posix_string() == std::string("MST+07"));
7979
check("to posix string",
80-
az2.to_posix_string() == std::string("MST-07"));
80+
az2.to_posix_string() == std::string("MST+07"));
8181

8282

8383
// bizzar time zone spec to fully test parsing
8484
std::cout << "\nFictitious time zone" << std::endl;
85-
posix_time_zone bz("BST+11:21:15BDT-00:28,M2.2.4/03:15:42,M11.5.2/01:08:53");
85+
posix_time_zone bz("BST-11:21:15BDT-00:28,M2.2.4/03:15:42,M11.5.2/01:08:53");
8686
check("hast dst", bz.has_dst());
8787
check("UTC offset", bz.base_utc_offset() == time_duration(11,21,15));
8888
check("Abbrev", bz.std_zone_abbrev() == std::string("BST"));
@@ -95,8 +95,8 @@ int main(){
9595

9696
// only checking start & end rules w/ 'J' notation
9797
std::cout << "\n'J' notation Start/End rule tests..." << std::endl;
98-
posix_time_zone la1(specs[4]); // "PST-08PDT,J124,J310"
99-
//posix_time_zone la1("PST-08PDT,J1,J365");// Jan1/Dec31
98+
posix_time_zone la1(specs[4]); // "PST+08PDT,J124,J310"
99+
//posix_time_zone la1("PST+08PDT,J1,J365");// Jan1/Dec31
100100
check("dst start", la1.dst_local_start_time(2003) ==
101101
ptime(date(2003,Feb,15),time_duration(1,30,0)));
102102
check("dst end", la1.dst_local_end_time(2003) ==
@@ -109,44 +109,44 @@ int main(){
109109
* be written in 'n' notation. The reverse is not true so 'n' notation
110110
* is used as the output for to_posix_string(). */
111111
check("to posix string",
112-
la1.to_posix_string() == std::string("PST-08PDT+01,45/01:30,310/02:00"));
112+
la1.to_posix_string() == std::string("PST+08PDT+01,45/01:30,310/02:00"));
113113

114114
// only checking start & end rules w/ 'n' notation
115115
std::cout << "\n'n' notation Start/End rule tests..." << std::endl;
116-
posix_time_zone la2(specs[5]); // "PST-08PDT,124,310"
117-
//posix_time_zone la2("PST-08PDT,0,365");// Jan1/Dec31
116+
posix_time_zone la2(specs[5]); // "PST+08PDT,124,310"
117+
//posix_time_zone la2("PST+08PDT,0,365");// Jan1/Dec31
118118
check("dst start", la2.dst_local_start_time(2003) ==
119119
ptime(date(2003,Feb,15),time_duration(2,0,0)));
120120
check("dst end", la2.dst_local_end_time(2003) ==
121121
ptime(date(2003,Nov,6),time_duration(0,30,0)));
122122
check("to posix string",
123-
la2.to_posix_string() == std::string("PST-08PDT+01,45/02:00,310/00:30"));
123+
la2.to_posix_string() == std::string("PST+08PDT+01,45/02:00,310/00:30"));
124124

125125
// bad posix time zone strings tests
126126
std::cout << "\nInvalid time zone string tests..." << std::endl;
127127
try {
128-
posix_time_zone badz("EST-13");
128+
posix_time_zone badz("EST+13");
129129
check("Exception not thrown: bad UTC offset", false);
130130
}catch(bad_offset& boff){
131131
std::string msg(boff.what());
132132
check("Exception caught: "+msg , true);
133133
}
134134
try {
135-
posix_time_zone badz("EST-5EDT24:00:01,J124/1:30,J310");
135+
posix_time_zone badz("EST+5EDT24:00:01,J124/1:30,J310");
136136
check("Exception not thrown: bad DST adjust", false);
137137
}catch(bad_adjustment& badj){
138138
std::string msg(badj.what());
139139
check("Exception caught: "+msg , true);
140140
}
141141
try {
142-
posix_time_zone badz("EST-5EDT01:00:00,J124/-1:30,J310");
142+
posix_time_zone badz("EST+5EDT01:00:00,J124/-1:30,J310");
143143
check("Exception not thrown: bad DST start/end offset", false);
144144
}catch(bad_offset& boff){
145145
std::string msg(boff.what());
146146
check("Exception caught: "+msg , true);
147147
}
148148
try {
149-
posix_time_zone badz("EST-5EDT01:00:00,J124/1:30,J370");
149+
posix_time_zone badz("EST+5EDT01:00:00,J124/1:30,J370");
150150
check("Exception not thrown: invalid date spec", false);
151151
}catch(boost::gregorian::bad_day_of_month& boff){
152152
std::string msg(boff.what());
@@ -163,7 +163,7 @@ int main(){
163163
//Test a timezone spec on the positive side of the UTC line.
164164
//This is the time for central europe which is one hour in front of UTC
165165
//Note these Summer time transition rules aren't actually correct.
166-
posix_time_zone cet_tz("CET+01:00:00EDT+01:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00");
166+
posix_time_zone cet_tz("CET-01:00:00EDT+01:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00");
167167
check("Has DST", cet_tz.has_dst());
168168
check("UTC offset", cet_tz.base_utc_offset() == hours(1));
169169
check("Abbrevs", cet_tz.std_zone_abbrev() == std::string("CET"));
@@ -174,7 +174,7 @@ int main(){
174174
//Test a timezone spec on the positive side of the UTC line.
175175
//This is the time for central europe which is one hour in front of UTC
176176
//Note these Summer time transition rules aren't actually correct.
177-
posix_time_zone caus_tz("CAS+08:30:00CDT+01:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00");
177+
posix_time_zone caus_tz("CAS-08:30:00CDT+01:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00");
178178
check("Has DST", caus_tz.has_dst());
179179
check("UTC offset", caus_tz.base_utc_offset() == hours(8)+minutes(30));
180180
check("Abbrevs", caus_tz.std_zone_abbrev() == std::string("CAS"));
@@ -183,7 +183,7 @@ int main(){
183183
{
184184
/**** first/last of month Julian & non-Julian tests ****/
185185
// Mar-01 & Oct-31, count begins at 1
186-
std::string spec("FST+3FDT,J60,J304");
186+
std::string spec("FST-3FDT,J60,J304");
187187
posix_time_zone fl_1(spec);
188188
check("Julian First/last of month", fl_1.dst_local_start_time(2003) ==
189189
ptime(date(2003,Mar,1),hours(2)));
@@ -195,7 +195,7 @@ int main(){
195195
ptime(date(2004,Oct,31),hours(2)));
196196

197197
// Mar-01 & Oct-31 Non-leap year, count begins at 0
198-
spec = "FST+3FDT,59,304"; // "304" is not a mistake here, see posix_time_zone docs
198+
spec = "FST-3FDT,59,304"; // "304" is not a mistake here, see posix_time_zone docs
199199
posix_time_zone fl_2(spec);
200200
try{
201201
check("Non-Julian First/last of month", fl_2.dst_local_start_time(2003) ==
@@ -207,7 +207,7 @@ int main(){
207207
ptime(date(2003,Oct,31),hours(2)));
208208

209209
// Mar-01 & Oct-31 leap year, count begins at 0
210-
spec = "FST+3FDT,60,304";
210+
spec = "FST-3FDT,60,304";
211211
posix_time_zone fl_3(spec);
212212
check("Non-Julian First/last of month", fl_3.dst_local_start_time(2004) ==
213213
ptime(date(2004,Mar,1),hours(2)));

0 commit comments

Comments
 (0)