Back to index

php5  5.3.10
DateTime_data-spring-type2-type2.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, Spring, Zone Type 2 to Zone Type 2
00013  *
00014  * + prev: the day before the transition day  2010-03-13 18:38:28 EST
00015  * + st: standard time on transition day      2010-03-14 00:10:20 EST
00016  * + dt: daylight time on the transition day  2010-03-14 03:16:55 EDT
00017  * + post: the day after the transition day   2010-03-15 19:59:59 EDT
00018  * + stsec: standard time 1 sec before change 2010-03-14 01:59:59 EST
00019  * + dtsec: daylight time first second        2010-03-14 03:00:00 EDT
00020  */
00021 echo "test_time_spring_type2_prev_type2_prev: ";
00022 $end   = new DateTime('2010-03-13 18:38:28 EST');  // prev, zt2
00023 $start = new DateTime('2010-02-11 02:18:48 EST');  // sp prev, zt2
00024 examine_diff($end, $start, 'P+0Y1M2DT16H19M40S', 30);
00025 
00026 echo "test_time_spring_type2_prev_type2_st: ";
00027 $end   = new DateTime('2010-03-14 00:10:20 EST');  // st, zt2
00028 $start = new DateTime('2010-03-13 18:38:28 EST');  // prev, zt2
00029 examine_diff($end, $start, 'P+0Y0M0DT5H31M52S', 0);
00030 
00031 echo "test_time_spring_type2_prev_type2_dt: ";
00032 $end   = new DateTime('2010-03-14 03:16:55 EDT');  // dt, zt2
00033 $start = new DateTime('2010-03-13 18:38:28 EST');  // prev, zt2
00034 examine_diff($end, $start, 'P+0Y0M0DT7H38M27S', 0);
00035 
00036 echo "test_time_spring_type2_prev_type2_post: ";
00037 $end   = new DateTime('2010-03-15 19:59:59 EDT');  // post, zt2
00038 $start = new DateTime('2010-03-13 18:38:28 EST');  // prev, zt2
00039 examine_diff($end, $start, 'P+0Y0M2DT1H21M31S', 2);
00040 
00041 echo "test_time_spring_type2_st_type2_prev: ";
00042 $end   = new DateTime('2010-03-13 18:38:28 EST');  // prev, zt2
00043 $start = new DateTime('2010-03-14 00:10:20 EST');  // st, zt2
00044 examine_diff($end, $start, 'P-0Y0M0DT5H31M52S', 0);
00045 
00046 echo "test_time_spring_type2_st_type2_st: ";
00047 $end   = new DateTime('2010-03-14 00:15:35 EST');  // sp st, zt2
00048 $start = new DateTime('2010-03-14 00:10:20 EST');  // st, zt2
00049 examine_diff($end, $start, 'P+0Y0M0DT0H5M15S', 0);
00050 
00051 echo "test_time_spring_type2_st_type2_dt: ";
00052 $end   = new DateTime('2010-03-14 03:16:55 EDT');  // dt, zt2
00053 $start = new DateTime('2010-03-14 00:10:20 EST');  // st, zt2
00054 examine_diff($end, $start, 'P+0Y0M0DT2H6M35S', 0);
00055 
00056 echo "test_time_spring_type2_st_type2_post: ";
00057 $end   = new DateTime('2010-03-15 19:59:59 EDT');  // post, zt2
00058 $start = new DateTime('2010-03-14 00:10:20 EST');  // st, zt2
00059 examine_diff($end, $start, 'P+0Y0M1DT18H49M39S', 1);
00060 
00061 echo "test_time_spring_type2_dt_type2_prev: ";
00062 $end   = new DateTime('2010-03-13 18:38:28 EST');  // prev, zt2
00063 $start = new DateTime('2010-03-14 03:16:55 EDT');  // dt, zt2
00064 examine_diff($end, $start, 'P-0Y0M0DT7H38M27S', 0);
00065 
00066 echo "test_time_spring_type2_dt_type2_st: ";
00067 $end   = new DateTime('2010-03-14 00:10:20 EST');  // st, zt2
00068 $start = new DateTime('2010-03-14 03:16:55 EDT');  // dt, zt2
00069 examine_diff($end, $start, 'P-0Y0M0DT2H6M35S', 0);
00070 
00071 echo "test_time_spring_type2_dt_type2_dt: ";
00072 $end   = new DateTime('2010-03-14 05:19:56 EDT');  // sp dt, zt2
00073 $start = new DateTime('2010-03-14 03:16:55 EDT');  // dt, zt2
00074 examine_diff($end, $start, 'P+0Y0M0DT2H3M1S', 0);
00075 
00076 echo "test_time_spring_type2_dt_type2_post: ";
00077 $end   = new DateTime('2010-03-15 19:59:59 EDT');  // post, zt2
00078 $start = new DateTime('2010-03-14 03:16:55 EDT');  // dt, zt2
00079 examine_diff($end, $start, 'P+0Y0M1DT16H43M4S', 1);
00080 
00081 echo "test_time_spring_type2_post_type2_prev: ";
00082 $end   = new DateTime('2010-03-13 18:38:28 EST');  // prev, zt2
00083 $start = new DateTime('2010-03-15 19:59:59 EDT');  // post, zt2
00084 examine_diff($end, $start, 'P-0Y0M2DT1H21M31S', 2);
00085 
00086 echo "test_time_spring_type2_post_type2_st: ";
00087 $end   = new DateTime('2010-03-14 00:10:20 EST');  // st, zt2
00088 $start = new DateTime('2010-03-15 19:59:59 EDT');  // post, zt2
00089 examine_diff($end, $start, 'P-0Y0M1DT18H49M39S', 1);
00090 
00091 echo "test_time_spring_type2_post_type2_dt: ";
00092 $end   = new DateTime('2010-03-14 03:16:55 EDT');  // dt, zt2
00093 $start = new DateTime('2010-03-15 19:59:59 EDT');  // post, zt2
00094 examine_diff($end, $start, 'P-0Y0M1DT16H43M4S', 1);
00095 
00096 echo "test_time_spring_type2_post_type2_post: ";
00097 $end   = new DateTime('2010-03-15 19:59:59 EDT');  // post, zt2
00098 $start = new DateTime('2010-03-15 18:57:55 EDT');  // sp post, zt2
00099 examine_diff($end, $start, 'P+0Y0M0DT1H2M4S', 0);
00100 
00101 echo "test_time_spring_type2_stsec_type2_dtsec: ";
00102 $end   = new DateTime('2010-03-14 03:00:00 EDT');  // dtsec, zt2
00103 $start = new DateTime('2010-03-14 01:59:59 EST');  // stsec, zt2
00104 examine_diff($end, $start, 'P+0Y0M0DT0H0M1S', 0);
00105 
00106 echo "test_time_spring_type2_dtsec_type2_stsec: ";
00107 $end   = new DateTime('2010-03-14 01:59:59 EST');  // stsec, zt2
00108 $start = new DateTime('2010-03-14 03:00:00 EDT');  // dtsec, zt2
00109 examine_diff($end, $start, 'P-0Y0M0DT0H0M1S', 0);