Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00041 function str2date($in){
00042
00043 $t = split("/",$in);
00044 if (count($t)!=3) $t = split("-",$in);
00045 if (count($t)!=3) $t = split(" ",$in);
00046
00047 if (count($t)!=3) return -4;
00048
00049 if (!is_numeric($t[0])) return -1;
00050 if (!is_numeric($t[1])) return -2;
00051 if (!is_numeric($t[2])) return -3;
00052 if ($t[2]<1902 || $t[2]>2037) return -3;
00053 if (!checkdate( $t[1], $t[0], $t[2] )) return -5;
00054
00055 return mktime (0,0,0, $t[1], $t[0], $t[2]);
00056 }
00057
00065 function setDateInTblHead($timestamp)
00066 {
00067
00068 $ttd = new TimestampToDate;
00069
00070 $ttd->ttd($timestamp);
00071 $S_Datum[week] = $ttd->weeknumber;
00072 $ttd->ttd($timestamp);
00073 $S_Datum[monday_full] = $ttd->extrashorttime ;
00074
00075 $ttd->ttd(strtotime ("+1 day" , $timestamp));
00076 $S_Datum[tuesday_full] = $ttd->extrashorttime ;
00077
00078 $ttd->ttd(strtotime ("+2 day" , $timestamp));
00079 $S_Datum[wednesday_full] = $ttd->extrashorttime ;
00080
00081 $ttd->ttd(strtotime ("+3 day" , $timestamp));
00082 $S_Datum[thursday_full] = $ttd->extrashorttime ;
00083
00084 $ttd->ttd(strtotime ("+4 day" , $timestamp));
00085 $S_Datum[friday_full] = $ttd->extrashorttime ;
00086
00087 $ttd->ttd(strtotime ("+5 day" , $timestamp));
00088 $S_Datum[saturday_full] = $ttd->extrashorttime ;
00089
00090 $ttd->ttd(strtotime ("+6 day" , $timestamp));
00091 $S_Datum[sunday_full] = $ttd->extrashorttime ;
00092
00093 Return $S_Datum;
00094 }
00095 ?>