PHP Tutorials Date and Time



Featured Tutorial
Feature your own tutorial here! Find out more.
Yesterdays date, the easy and hard way in PHP
Submitted by moozer » Dates can be hard to work with in PHP, here we learn you the simple way of getting yesterdays date (and other dates relative to today)
Rating: 2.3/5 | 347 clicks | 0 comments | 0 saves | share | report
How to Find a Random Date in PHP
Submitted by Web Cash » This tutorial walks you through how to use a few simple functions - strotime(), date(), and rand() - to find a random date in PHP. The end result is a simple one-line command, which you can place in a function and re-use in your own scripts.
Rating: 2.5/5 | 156 clicks | 0 comments | 1 save | share | report
Timezone Class: Dealing with Timezones the Proper Way
Submitted by Adam » Using the Timezone class to automatically deduce the timezone's GMT offset and then modify the date accordingly. I must admit that I was going to write you a simple timezone script and then tell you how easy it was. However, I came across some handy timezone_* functions and things got a little more difficult but a lot more practical. This script will allow you to display the time in any timezone you wish, without any ifs, buts or maybes along the way.
Rating: 3.0/5 | 239 clicks | 0 comments | 0 saves | share | report
Calculate the age of your users by filling out a form.
Submitted by AVENGEX: Coding & webmaster development » If you want to impose restrictions on age when people visit your website, or sign up, you'll need to calculate a user's age through a form - since web servers aren't psychic - yet.
Rating: 3.0/5 | 1,180 clicks | 0 comments | 0 saves | share | report
PHP Date Function
Submitted by ProgrammingPHP.net » Discusses the uses of the date function, showing examples of how to implement parameters, how to literally process characters within it, and more. Concludes with a list of most date function parameters, descriptions of what they output and examples.
Rating: 3.4/5 | 1,161 clicks | 0 comments | 1 save | share | report
Using PHP To Get Days Between Two Dates
Submitted by Kane » This is a simple snippet of code that will return an array of days between two dates.
Rating: 2.7/5 | 948 clicks | 0 comments | 0 saves | share | report
Formatting Dates in PHP
Submitted by Kane » Ok, so how do you format dates in PHP so it outputs the date format you want? Well thanks to PHP’s date() and strtotime() function, we can do all that!
Rating: 3.0/5 | 994 clicks | 0 comments | 0 saves | share | report
Creating Calendar in PHP
Submitted by Phptoys » In this tutorial I will show you how to create a calendar script in PHP. We will create a simple but good looking - easy customizable via CSS - calendar table.
Rating: 3.0/5 | 2,380 clicks | 0 comments | 1 save | share | report
PHP date function explained
Submitted by tutorials-expert.com » With PHP's date function you format timestamps, so they are more human readable. The following tutorial will teach you how to display the current time, formating PHP's timestamp, and show you all the various date arguments for reference purposes.
Rating: 3.0/5 | 1,037 clicks | 0 comments | 1 save | share | report