<?
function WeekDates(){
for($x=0; $x<=6; $x++){
$DateArray[$x] = date('Y-m-d',mktime(0,0,0,date('m'),date('d')-date('w')+$x,date('Y')));
}
return $DateArray;
}
?>
To use this function and see the results you may try this :
<?
$Array=WeekDates();
For($i = 0 ; $i < 6 ; $i++) {
Echo $Array[$i] . "<BR>";
}
?>
Based on a small thread from the PHP list by David Rice
Convert MYSQL timestamp (14) fields back to UNIX epoch (seconds) format for display with the date() function. "revertTimeStamp($timestamp)" Categories : PHP , Date Time , MySQL Shows the current time as a PNG-image. This script does not use the GD
library. You can use it as a benchmark (because it's slow), or as a quick
reference for implementing a simple PNG-file generator. Categories : Graphics , Zlib , Calendar , PHP , Date Time pcCalendar class - Allows for the creation of calendars in HTML pages. All output functions can be easily overridden, refer to article 1471 for an example.
Categories : PHP , Date Time , Calendar , PHP Classes A wrapper function to format dates coming from a databases with the
same syntax as PHP's date() function. Categories : Date Time , Databases , PHP Date Validation using JavaScript. Intended to use it as checkdate() from PHP. Categories : Java Script , Date Time , PHP a class that uses microtime() to provide easy calculation of elapsed times
Categories : Date Time , PHP , PHP Classes Simple function to return the number of days in a time span between 2 given dates. Categories : PHP , Date Time , MySQL , Databases Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example. Categories : PHP , Date Time , PHP Classes , Calendar Bs_StopWatch is a class to measure time intervals in microseconds.
Categories : PHP , Date Time , PHP Classes Calendars to choose a range of dates , reservation events ... Categories : PHP , Calendar , Java Script , Date Time Function to convert Arabic numbers into Roman Numerals Categories : Algorithms , PHP , Date Time function to generate calendars on the fly.
Categories : Calendar , PHP , Date Time Simple conversion functions to change MySQL dates to arrays, arrays to MySQL dates.
Categories : PHP , Arrays , Date Time , Databases , MySQL Change the background color of a website daily dynamically using the php date function to get the current day of the week and depending on that day, set the background color for the web page. Categories : PHP , Date Time , Beginner Guides , Web Design Customizable Calendar Class Categories : HTML and PHP , Date Time , PHP , PHP Classes , Calendar
Fred Schenk wrote : 913
I don`t have php at hand here and the author doesn`t have the time to test it (...) but can this code cope with month- and year-endings? So did anybody test it with 31-12-2002, 1-1-2003, 28-2-2003 etc. instead of the $date?
Boaz Yahav wrote : 914
This example can`t take care of the dates spesified by Fred. You can see an improved one at :
http://examples.weberdev.com/get_example.php3?count=3588