|
||||||||||||||||||||||
Date and Time : IntroductionThis article is going to cover how to use dates and times in PHP. Theres alot you can do. Dates and Times are important. On dynamic websites, the last edit date of a topic, or a calander event are reguarly needed and provide valuable information to the end user. To get you going though, you need to know about several functions.
Overview
Date and StrftimeThe date() function. This is important because it allows you to format the output of either the current, or a given date/time.
Time and MktimeExplains how to use the mktime() to make theoretical times in a UNIX timestamp format.
MySQL Date and TimeStoring date and times in MySQL a database. Field types, and returning a UNIX timestamp for use with the date() function.
Adding and subtracting TimeAdvancing on the examples from Mktime, you can create times in the past and future using these functions. You can also work out the different between two times. Contains useful custom functions that you can use in your own scripts.
Calander count down scriptAn example script which reports the 'time to event', based on a given timezone.
Author: Markavian |
tutorial Pages
|
|||||||||||||||||||||