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
PHP Web Logs (BLogs)
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
Submit Site
Forex Trading Online forex trading platform

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 : Spreadsheet Date Calculations in PHP
Categories : PHP, Date Time, Excel Click here to Update Your Picture
Ray Hauge
Date : Feb 02nd 2006
Grade : 2 of 5 (graded 7 times)
Viewed : 5855
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Ray Hauge
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<?
/*
I recently ran into a problem when saving a spreadsheet to a CSV file would change the dates I saw to the spreadsheet's Internal Date Format (just a plain old number).  After a lot of searching I found the algorithm needed to calculate the date.
*/


function ExcelToDate($inVar) {
  return
date("m/d/Y",(($inVar - 25569)*86400)-7200);
}

$var = 38147.53801; // Date ix "Excel"-format
echo ExcelToDate($var);


/*
I have found that OpenOffice is a bit different from Excel in the date calculations.  OO uses an Internal Date format that is a day earlier.  Thus, the function would need to be changed to:
*/

function OOToDate($inVar) {
  return
date("m/d/Y",(($inVar - 25568)*86400)-7200);
}
?>



Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
A Timing Class
Categories : PHP, PHP Classes, Date Time
Finding the day of the week for a specific date.
Categories : PHP, Databases, MySQL, Date Time
A wrapper function to format dates coming from a databases with the same syntax as PHP's date() function.
Categories : Date Time, Databases, PHP
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
PHP Round Clock - Must have Gif support to use this.
Categories : PHP, Date Time, Graphics
A simple and fast calendar combining PHP and tables. Use this as a base for applications in which a calendar is needed.
Categories : Date Time, PHP, Complete Programs, Calendar
mysql date/time converters
Categories : PHP, MySQL, Databases, Date Time
Creates three SELECT form fields: Month, Day, and Year. You give it a string which will be used to make the name for the three fields, and a number of seconds to use as the default date. If you give it blank for this value, the current date is used.
Categories : HTML and PHP, PHP, Date Time
If you want to create select buttons featuring current date this example will show you how...
Categories : Date Time, HTML and PHP, PHP
Example of using the pcCalendar class, article 1468 on weberdev.com. Calendar example.
Categories : PHP, Date Time, PHP Classes, Calendar
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
calculus of the eastersunday
Categories : BC math, PHP, Date Time, Databases
Functions used to define a schedule of holidays. Can define non-fixed holidays (eg. 3rd sunday of June).
Categories : Calendar, Date Time, PHP
Monthly and Daily Upcoming Events calendar.
Categories : Date Time, PostgreSQL, PHP, Calendar, Databases