|
|
|
This class can be used for local date notations. You need to translate the week-days and month names in your local language.
| <?php
class local_date {
var $week_day;
var $day;
var $month;
var $year;
function local_date() { //constructor
$this->week_day = date("l");
$this->day = date("j");
$this->month = date("n");
$this->year = date("Y");
}
//translate in local language
function get_day() {
$nl_day = array("Monday" => "Maandag", "Tuesday" => "Dinsdag", "Wednesday" => "Woensdag", "Thursday" => "Donderdag", "Friday" => "Vrijdag", "Saturday" => "Zaterdag", "Sunday" => "Zondag");
return $nl_day[$this->week_day];
}
function get_month() {
$nl_month = array("1" => "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "october", "november", "december");
return $nl_month[$this->month];
}
function build_date() {
$long_date = $this->day." ".$this->get_month()." ".$this->year;
return $long_date;
}
}
?> | |
Usage Example
| <?php
$my_date = new local_date;
echo $my_date->get_day().", ".$my_date->build_date();
// this will output "Woensdag, 7 juli 2004"
?> | | |
|
| A Timing Class Categories : PHP, PHP Classes, 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 PHP Calendar function with CSS : add a cool calendar to any php page by just adding a calendar class based function. Categories : PHP, PHP Classes, Calendar, Date Time | | | Open and Close your website in fixed times . Categories : PHP, PHP Classes, Cron, Date Time | | | Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example. Categories : PHP, Date Time, PHP Classes, Calendar | | | Validator - A PHP class that can can be used for validating Email IDs and Dates Categories : PHP, PHP Classes, Data Validation, Email, Date Time | | | A time measuring and performance benchmarking class Categories : PHP, PHP Classes, Testing, Debugging, Date Time | | | Bs_StopWatch is a class to measure time intervals in microseconds.
Categories : PHP, Date Time, PHP Classes | | | Customizable Calendar Class Categories : HTML and PHP, Date Time, PHP, PHP Classes, Calendar | | | a class that uses microtime() to provide easy calculation of elapsed times
Categories : Date Time, PHP, PHP Classes | | | very simple ftp class Categories : PHP, PHP Classes, FTP | | | PHP Paypal IPN Integration Class v1.0.0 Categories : PHP, PHP Classes, Payment Gateways | | | The class to check load time of your script
VERY usefull for relatively slow applications, but not only.. Categories : PHP, PHP Classes, Debugging | | | Create HTML forms dynamicly using Javascript & PHP Categories : PHP, PHP Classes, Java Script | | | usercounter class Categories : PHP, PHP Classes, Databases, MySQL, Environment Variables | |
|
|
|