News Tutorials Projects Reviews Authors Contact Search Links Admin
 

Date and Time : Introduction

This 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 Strftime

The date() function. This is important because it allows you to format the output of either the current, or a given date/time.

Time and Mktime

Explains how to use the mktime() to make theoretical times in a UNIX timestamp format.

MySQL Date and Time

Storing date and times in MySQL a database. Field types, and returning a UNIX timestamp for use with the date() function.

Adding and subtracting Time

Advancing 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 script

An example script which reports the 'time to event', based on a given timezone.

 


Author: Markavian
Last edited on: 8th Dec, 12:50 am
Please rate this article.

» Next Page 'Date and Strftime' »

tutorial Pages