@@ -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 << " \n Fictitious 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 << " \n Invalid 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