Back to index

php5  5.3.10
DateTime_data-fall-type2-type3.inc
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * Note: test names match method names in a set of PHPUnit tests
00005  * in a userland package.  Please be so kind as to leave them.
00006  */
00007 
00008 date_default_timezone_set('America/New_York');
00009 
00010 
00011 /*
00012  * Time, Fall, Zone Type 2 to Zone Type 3
00013  *
00014  * + prev: the day before the transition day  2010-11-06 18:38:28 EDT
00015  * + dt: daylight time on transition day      2010-11-07 00:10:20 EDT
00016  * + redodt: daylight time in the redo period 2010-11-07 01:12:33 EDT
00017  * + redost: standard time in the redo period 2010-11-07 01:14:44 EST
00018  * + st: standard time on the transition day  2010-11-07 03:16:55 EST
00019  * + post: the day after the transition day   2010-11-08 19:59:59 EST
00020  * + dtsec: daylight time 1 sec before change 2010-11-07 01:59:59 EDT
00021  * + stsec: standard time first second        2010-11-07 01:00:00 EST
00022  */
00023 echo "test_time_fall_type2_prev_type3_prev: ";
00024 $end   = new DateTime('2010-11-06 18:38:28');  // prev, zt3
00025 $start = new DateTime('2010-10-04 02:18:48 EDT');  // sp prev, zt2
00026 examine_diff($end, $start, 'P+0Y1M2DT16H19M40S', 33);
00027 
00028 echo "test_time_fall_type2_prev_type3_dt: ";
00029 $end   = new DateTime('2010-11-07 00:10:20');  // dt, zt3
00030 $start = new DateTime('2010-11-06 18:38:28 EDT');  // prev, zt2
00031 examine_diff($end, $start, 'P+0Y0M0DT5H31M52S', 0);
00032 
00033 echo "test_time_fall_type2_prev_type3_redodt: ";
00034 $end   = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00035 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00036 $start = new DateTime('2010-11-06 18:38:28 EDT');  // prev, zt2
00037 examine_diff($end, $start, 'P+0Y0M0DT6H34M5S', 0);
00038 
00039 echo "test_time_fall_type2_prev_type3_redost: ";
00040 $end   = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00041 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00042 $start = new DateTime('2010-11-06 18:38:28 EDT');  // prev, zt2
00043 examine_diff($end, $start, 'P+0Y0M0DT7H36M16S', 0);
00044 
00045 echo "test_time_fall_type2_prev_type3_st: ";
00046 $end   = new DateTime('2010-11-07 03:16:55');  // st, zt3
00047 $start = new DateTime('2010-11-06 18:38:28 EDT');  // prev, zt2
00048 examine_diff($end, $start, 'P+0Y0M0DT9H38M27S', 0);
00049 
00050 echo "test_time_fall_type2_prev_type3_post: ";
00051 $end   = new DateTime('2010-11-08 19:59:59');  // post, zt3
00052 $start = new DateTime('2010-11-06 18:38:28 EDT');  // prev, zt2
00053 examine_diff($end, $start, 'P+0Y0M2DT1H21M31S', 2);
00054 
00055 echo "test_time_fall_type2_dt_type3_prev: ";
00056 $end   = new DateTime('2010-11-06 18:38:28');  // prev, zt3
00057 $start = new DateTime('2010-11-07 00:10:20 EDT');  // dt, zt2
00058 examine_diff($end, $start, 'P-0Y0M0DT5H31M52S', 0);
00059 
00060 echo "test_time_fall_type2_dt_type3_dt: ";
00061 $end   = new DateTime('2010-11-07 00:15:35');  // sp dt, zt3
00062 $start = new DateTime('2010-11-07 00:10:20 EDT');  // dt, zt2
00063 examine_diff($end, $start, 'P+0Y0M0DT0H5M15S', 0);
00064 
00065 echo "test_time_fall_type2_dt_type3_redodt: ";
00066 $end   = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00067 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00068 $start = new DateTime('2010-11-07 00:10:20 EDT');  // dt, zt2
00069 examine_diff($end, $start, 'P+0Y0M0DT1H2M13S', 0);
00070 
00071 echo "test_time_fall_type2_dt_type3_redost: ";
00072 $end   = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00073 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00074 $start = new DateTime('2010-11-07 00:10:20 EDT');  // dt, zt2
00075 examine_diff($end, $start, 'P+0Y0M0DT2H4M24S', 0);
00076 
00077 echo "test_time_fall_type2_dt_type3_st: ";
00078 $end   = new DateTime('2010-11-07 03:16:55');  // st, zt3
00079 $start = new DateTime('2010-11-07 00:10:20 EDT');  // dt, zt2
00080 examine_diff($end, $start, 'P+0Y0M0DT4H6M35S', 0);
00081 
00082 echo "test_time_fall_type2_dt_type3_post: ";
00083 $end   = new DateTime('2010-11-08 19:59:59');  // post, zt3
00084 $start = new DateTime('2010-11-07 00:10:20 EDT');  // dt, zt2
00085 examine_diff($end, $start, 'P+0Y0M1DT20H49M39S', 1);
00086 
00087 echo "test_time_fall_type2_redodt_type3_prev: ";
00088 $end   = new DateTime('2010-11-06 18:38:28');  // prev, zt3
00089 $start = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00090 examine_diff($end, $start, 'P-0Y0M0DT6H34M5S', 0);
00091 
00092 echo "test_time_fall_type2_redodt_type3_dt: ";
00093 $end   = new DateTime('2010-11-07 00:10:20');  // dt, zt3
00094 $start = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00095 examine_diff($end, $start, 'P-0Y0M0DT1H2M13S', 0);
00096 
00097 echo "test_time_fall_type2_redodt_type3_redodt: ";
00098 $end   = new DateTime('2010-11-07 01:15:35 EDT');  // sp redodt, zt2
00099 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00100 $start = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00101 examine_diff($end, $start, 'P+0Y0M0DT0H3M2S', 0);
00102 
00103 echo "test_time_fall_type2_redodt_type3_redost: ";
00104 $end   = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00105 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00106 $start = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00107 examine_diff($end, $start, 'P+0Y0M0DT1H2M11S', 0);
00108 
00109 echo "test_time_fall_type2_redodt_type3_st: ";
00110 $end   = new DateTime('2010-11-07 03:16:55');  // st, zt3
00111 $start = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00112 examine_diff($end, $start, 'P+0Y0M0DT3H4M22S', 0);
00113 
00114 echo "test_time_fall_type2_redodt_type3_post: ";
00115 $end   = new DateTime('2010-11-08 19:59:59');  // post, zt3
00116 $start = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00117 examine_diff($end, $start, 'P+0Y0M1DT19H47M26S', 1);
00118 
00119 echo "test_time_fall_type2_redost_type3_prev: ";
00120 $end   = new DateTime('2010-11-06 18:38:28');  // prev, zt3
00121 $start = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00122 examine_diff($end, $start, 'P-0Y0M0DT7H36M16S', 0);
00123 
00124 echo "test_time_fall_type2_redost_type3_dt: ";
00125 $end   = new DateTime('2010-11-07 00:10:20');  // dt, zt3
00126 $start = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00127 examine_diff($end, $start, 'P-0Y0M0DT2H4M24S', 0);
00128 
00129 echo "test_time_fall_type2_redost_type3_redodt: ";
00130 $end   = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00131 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00132 $start = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00133 examine_diff($end, $start, 'P-0Y0M0DT1H2M11S', 0);
00134 
00135 echo "test_time_fall_type2_redost_type3_redost: ";
00136 $end   = new DateTime('2010-11-07 01:16:54 EST');  // sp redodt, zt2
00137 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00138 $start = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00139 examine_diff($end, $start, 'P+0Y0M0DT0H2M10S', 0);
00140 
00141 echo "test_time_fall_type2_redost_type3_st: ";
00142 $end   = new DateTime('2010-11-07 03:16:55');  // st, zt3
00143 $start = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00144 examine_diff($end, $start, 'P+0Y0M0DT2H2M11S', 0);
00145 
00146 echo "test_time_fall_type2_redost_type3_post: ";
00147 $end   = new DateTime('2010-11-08 19:59:59');  // post, zt3
00148 $start = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00149 examine_diff($end, $start, 'P+0Y0M1DT18H45M15S', 1);
00150 
00151 echo "test_time_fall_type2_st_type3_prev: ";
00152 $end   = new DateTime('2010-11-06 18:38:28');  // prev, zt3
00153 $start = new DateTime('2010-11-07 03:16:55 EST');  // st, zt2
00154 examine_diff($end, $start, 'P-0Y0M0DT9H38M27S', 0);
00155 
00156 echo "test_time_fall_type2_st_type3_dt: ";
00157 $end   = new DateTime('2010-11-07 00:10:20');  // dt, zt3
00158 $start = new DateTime('2010-11-07 03:16:55 EST');  // st, zt2
00159 examine_diff($end, $start, 'P-0Y0M0DT4H6M35S', 0);
00160 
00161 echo "test_time_fall_type2_st_type3_redodt: ";
00162 $end   = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00163 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00164 $start = new DateTime('2010-11-07 03:16:55 EST');  // st, zt2
00165 examine_diff($end, $start, 'P-0Y0M0DT3H4M22S', 0);
00166 
00167 echo "test_time_fall_type2_st_type3_redost: ";
00168 $end   = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00169 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00170 $start = new DateTime('2010-11-07 03:16:55 EST');  // st, zt2
00171 examine_diff($end, $start, 'P-0Y0M0DT2H2M11S', 0);
00172 
00173 echo "test_time_fall_type2_st_type3_st: ";
00174 $end   = new DateTime('2010-11-07 05:19:56');  // sp st, zt3
00175 $start = new DateTime('2010-11-07 03:16:55 EST');  // st, zt2
00176 examine_diff($end, $start, 'P+0Y0M0DT2H3M1S', 0);
00177 
00178 echo "test_time_fall_type2_st_type3_post: ";
00179 $end   = new DateTime('2010-11-08 19:59:59');  // post, zt3
00180 $start = new DateTime('2010-11-07 03:16:55 EST');  // st, zt2
00181 examine_diff($end, $start, 'P+0Y0M1DT16H43M4S', 1);
00182 
00183 echo "test_time_fall_type2_post_type3_prev: ";
00184 $end   = new DateTime('2010-11-06 18:38:28');  // prev, zt3
00185 $start = new DateTime('2010-11-08 19:59:59 EST');  // post, zt2
00186 examine_diff($end, $start, 'P-0Y0M2DT1H21M31S', 2);
00187 
00188 echo "test_time_fall_type2_post_type3_dt: ";
00189 $end   = new DateTime('2010-11-07 00:10:20');  // dt, zt3
00190 $start = new DateTime('2010-11-08 19:59:59 EST');  // post, zt2
00191 examine_diff($end, $start, 'P-0Y0M1DT20H49M39S', 1);
00192 
00193 echo "test_time_fall_type2_post_type3_redodt: ";
00194 $end   = new DateTime('2010-11-07 01:12:33 EDT');  // redodt, zt2
00195 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00196 $start = new DateTime('2010-11-08 19:59:59 EST');  // post, zt2
00197 examine_diff($end, $start, 'P-0Y0M1DT19H47M26S', 1);
00198 
00199 echo "test_time_fall_type2_post_type3_redost: ";
00200 $end   = new DateTime('2010-11-07 01:14:44 EST');  // redost, zt2
00201 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00202 $start = new DateTime('2010-11-08 19:59:59 EST');  // post, zt2
00203 examine_diff($end, $start, 'P-0Y0M1DT18H45M15S', 1);
00204 
00205 echo "test_time_fall_type2_post_type3_st: ";
00206 $end   = new DateTime('2010-11-07 03:16:55');  // st, zt3
00207 $start = new DateTime('2010-11-08 19:59:59 EST');  // post, zt2
00208 examine_diff($end, $start, 'P-0Y0M1DT16H43M4S', 1);
00209 
00210 echo "test_time_fall_type2_post_type3_post: ";
00211 $end   = new DateTime('2010-11-08 19:59:59');  // post, zt3
00212 $start = new DateTime('2010-11-08 18:57:55 EST');  // sp post, zt2
00213 examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
00214 
00215 echo "test_time_fall_type2_dtsec_type3_stsec: ";
00216 $end   = new DateTime('2010-11-07 01:00:00 EST');  // stsec, zt2
00217 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00218 $start = new DateTime('2010-11-07 01:59:59 EDT');  // dtsec, zt2
00219 examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
00220 
00221 echo "test_time_fall_type2_stsec_type3_dtsec: ";
00222 $end   = new DateTime('2010-11-07 01:59:59 EDT');  // dtsec, zt2
00223 $end->setTimezone(new DateTimeZone('America/New_York'));  // zt2 -> zt3
00224 $start = new DateTime('2010-11-07 01:00:00 EST');  // stsec, zt2
00225 examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);