PHP Classes
elePHPant
Icontem

File: teste

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Olavo Alexandrino  >  EasyDate  >  teste  >  Download  
File: teste
Role: Example script
Content type: text/plain
Description: Test EasyDate
Class: EasyDate
Manipulation of dates
Author: By
Last change: Added method dayinWeek
Date: 11 years ago
Size: 4,593 bytes
 

Contents

Class file image Download
<?@include "class.EasyDate.php";?>
<?
#################################################################################################
/*
                                        Class EasyDate
                                            (example)
                                       All Rights Reserved
                                     Autor: Olavo Alexandrino
                                 Contact: oalexandrino@hotmail.com
                                       Recife - PE - Brazil
                                           August 2003
*/
#################################################################################################

$ClassData = new EasyDate("en");

##########################################################################
# Alternative method - Modo Brasileiro
# Desse modo os parâmetros deverão estar no modo brasileiro
# $ClassData = new EasyDate();
# All the methods of the class will assume the Brazilian Portuguese language as standard

##########################################################################

echo "<li type=square><strong>getStringCurrentDateAndTime()</strong><br>";
echo
$ClassData->getStringCurrentDateAndTime();
echo
"<br><br>";

echo
"<li type=square><strong>getFullStringCurrentDate()</strong><br>";
echo
$ClassData->getFullStringCurrentDate();
echo
"<br><br>";

echo
"<li type=square><strong>getStringCurrentTime()</strong><br>";
echo
$ClassData->getStringCurrentTime();
echo
"<br><br>";

echo
"<li type=square><strong>getStringCurrentDayAndMonthAndYear()</strong><br>";
echo
$ClassData->getStringCurrentDayAndMonthAndYear();
echo
"<br><br>";

echo
"<li type=square><strong>getStringCurrentMonthAndYear()</strong><br>";
echo
$ClassData->getStringCurrentMonthAndYear();
echo
"<br><br>";

echo
"<li type=square><strong>getStringCurrentMonth()</strong><br>";
echo
$ClassData->getStringCurrentMonth();
echo
"<br><br>";

echo
"<li type=square><strong>getStringCurrentMonthParam(4)</strong><br>";
echo
$ClassData->getStringCurrentMonthParam(4);
echo
"<br><br>";

echo
"<li type=square><strong>getStringSmallCurrentMonthParam(4)</strong><br>";
echo
$ClassData->getStringSmallCurrentMonthParam(4);
echo
"<br><br>";

echo
"<li type=square><strong>getStringCurrentMonthYearInDate(\"1981-04-08\")</strong><br>";
echo
$ClassData->getStringCurrentMonthYearInDate("1981-04-08");
echo
"<br><br>";


echo
"<li type=square><strong>getStringCurrentDayMonthYearInDate(\"1981-04-08\")</strong><br>";
echo
$ClassData->getStringCurrentDayMonthYearInDate("1981-04-08");
echo
"<br><br>";


echo
"<li type=square><strong>getIntDayInDateMySQL(\"1981-04-08\")</strong><br>";
echo
$ClassData->getIntDayInDateMySQL("1981-04-08");
echo
"<br><br>";

echo
"<li type=square><strong>getIntMonthInDateMySQL(\"1981-04-08\")</strong><br>";
echo
$ClassData->getIntMonthInDateMySQL("1981-04-08");
echo
"<br><br>";

echo
"<li type=square><strong>getIntYearInDateMySQL(\"1981-04-08\")</strong><br>";
echo
$ClassData->getIntYearInDateMySQL("1981-04-08");
echo
"<br><br>";

echo
"<li type=square><strong>getIntDayInDateBrazilian(\"08/04/1981\")</strong><br>";
echo
$ClassData->getIntDayInDateBrazilian("08/04/1981");
echo
"<br><br>";

echo
"<li type=square><strong>getIntMonthInDateBrazilian(\"08/04/1981\")</strong><br>";
echo
$ClassData->getIntMonthInDateBrazilian("08/04/1981");
echo
"<br><br>";

echo
"<li type=square><strong>getIntYearInDateBrazilian(\"08/04/1981\")</strong><br>";
echo
$ClassData->getIntYearInDateBrazilian("08/04/1981");
echo
"<br><br>";

echo
"<li type=square><strong>mysqlToBrazilianFormat(\"1981-04-08\")</strong><br>";
echo
$ClassData->mysqlToBrazilianFormat("1981-04-08");
echo
"<br><br>";

echo
"<li type=square><strong>brazilianToMySQLFormat(\"08/04/1981\")</strong><br>";
echo
$ClassData->brazilianToMySQLFormat("08/04/1981");
echo
"<br><br>";

echo
"<li type=square><strong>getDaysInMonth(4,1981)</strong><br>";
echo
$ClassData->getDaysInMonth(4,1981);
echo
"<br><br>";

##########################################################
# Brazilian Format
$date = "08/04/1981";

# Alternative method #
# English (MySQL) Format
// $date = "1981-04-08";
// $date = $ClassData->mysqlToBrazilianFormat($date);
##########################################################

echo "<li type=square><strong>incrementDaysInDate(\"$date\",17854)</strong><br>";
echo
$ClassData->incrementDaysInDate("$date",17854);
echo
"<br><br>";
echo
"<li type=square><strong>dayInWeek(\"2004-01-22\")</strong><br>";
echo
$ClassData->dayInWeek("2004-01-22");
?>