WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Year 2000 compliant 'localtime()' function for PHP.
Categories : PHP, Date Time Click here to Update Your Picture
Ulrich Kapp
Date : Feb 13th 2001
Grade : Be the 1st to grade this Code Example
Viewed : 2606
File : localtime_y2k.php
Images : No Images for this code example.
Search : More code by Ulrich Kapp
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

This small piece of code makes the 'localtime()' function in PHP Y2K compliant.
(I wonder why the people at Zend didn't do that with the release of PHP4)
Maybe it was not so important, but it's nice to have.

<?
function localtime_y2k ($time, $is_ass) {
        $t_arr = localtime ($time, $is_ass);
        if ($is_ass == 0) $t_arr[5] = $t_arr[5] + 1900;
        if ($is_ass == 1) $t_arr["tm_year"] = $t_arr["tm_year"] + 1900;
        return $t_arr;
}
?>

You can also download the file. There you'll find the function in a test document.



Local-to-user date and time display regardless of time zone or where the website's server is located
Categories : PHP, Date Time, HTML and PHP, Java Script
Script loading time
Categories : PHP, Beginner Guides, Date Time
Spreadsheet Date Calculations in PHP
Categories : PHP, Date Time, Excel
formating MySQL Timestamp to get a propper Output. related : Timestamp, ereg_replace, mysql, substr
Categories : MySQL, PHP, Date Time, Databases
Simple PHP control CSS Calendar
Categories : PHP, HTML and PHP, Calendar, Date Time, CSS
A PHP Script that shows how to use FTP to run a shell script, read two local files and update data in a database.
Categories : PHP, Filesystem, FTP, Date Time, Databases
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
This script obtains the current Universal Time from the National Institute of Standards and Technology of the United States of America.
Categories : PHP, Date Time
How to Insert a Date Format Into MySQL from PHP
Categories : PHP, Databases, MySQL, Date Time, Beginner Guides
A time measuring and performance benchmarking class
Categories : PHP, PHP Classes, Testing, Debugging, Date Time
Function that returns an array with the 7 dates of the week that belong to the supplied date.
Categories : PHP, Date Time, Arrays
Query Timer
Categories : PHP, Databases, Date Time
mysql date/time converters
Categories : PHP, MySQL, Databases, Date Time
This code consists of two parts, the first part is a .html file that uses a form to pass 3 date variables into day_of_week.php3 You input the mm/dd/yyyy of the day then it prints what day of the week that day falls on.
Categories : Date Time, PHP, Complete Programs
Find the day of the week for any given year/month/day.
Categories : PHP, Date Time, Data Validation, Algorithms, Beginner Guides