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
00044 function str2date($in){
00045
00046 $t = split("/",$in);
00047 if (count($t)!=3) $t = split("-",$in);
00048 if (count($t)!=3) $t = split(" ",$in);
00049
00050 if (count($t)!=3) return -4;
00051
00052 if (!is_numeric($t[0])) return -1;
00053 if (!is_numeric($t[1])) return -2;
00054 if (!is_numeric($t[2])) return -3;
00055 if ($t[2]<1902 || $t[2]>2037) return -3;
00056 if (!checkdate( $t[1], $t[0], $t[2] )) return -5;
00057
00058 return mktime (0,0,0, $t[1], $t[0], $t[2]);
00059 }
00060
00068 function setDateInTblHead($timestamp)
00069 {
00070
00071 $ttd = new TimestampToDate;
00072
00073 $ttd->ttd($timestamp);
00074 $S_Datum[week] = $ttd->weeknumber;
00075 $ttd->ttd($timestamp);
00076 $S_Datum[monday_full] = $ttd->extrashorttime ;
00077
00078 $ttd->ttd(strtotime ("+1 day" , $timestamp));
00079 $S_Datum[tuesday_full] = $ttd->extrashorttime ;
00080
00081 $ttd->ttd(strtotime ("+2 day" , $timestamp));
00082 $S_Datum[wednesday_full] = $ttd->extrashorttime ;
00083
00084 $ttd->ttd(strtotime ("+3 day" , $timestamp));
00085 $S_Datum[thursday_full] = $ttd->extrashorttime ;
00086
00087 $ttd->ttd(strtotime ("+4 day" , $timestamp));
00088 $S_Datum[friday_full] = $ttd->extrashorttime ;
00089
00090 $ttd->ttd(strtotime ("+5 day" , $timestamp));
00091 $S_Datum[saturday_full] = $ttd->extrashorttime ;
00092
00093 $ttd->ttd(strtotime ("+6 day" , $timestamp));
00094 $S_Datum[sunday_full] = $ttd->extrashorttime ;
00095
00096 Return $S_Datum;
00097 }
00098 ?>