Software, your way.
burger menu icon
WillMaster

WillMaster > LibraryGenerators and Converters

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Formatting Date and Time

When a person wants to publish a date or time on a web page with PHP, they generally want to publish something quick and simple.

Unfortunately, there are a myriad of ways to publish dates and times. Here is a sampling, all representing the moment this page was loaded (using GMT time zone).

3 December 2024 3 Dec 24 3/12/24 12/3/24 2024-12-03 Tuesday, December 3, 2024 17:30:02 5:30 PM 05:30 pm

Further below is a generator designed to help you create the PHP code to publish a perfectly formatted date or time on your web page.

The generator presents the dozens of cryptic formatting characters as easy-to-understand descriptions. Tap the "3‑letter day of the week name" description, for example, and the generator correctly inserts the character "D" into the format you will use.

(All date and time formatting characters and what they're used for are listed on the PHP date() Manual page.)

The date/time code format generator has an input field where formatting, space, and punctuation characters are specified.

The formatting characters are inserted by tapping the short descriptions for formatting options you choose. (The descriptions are below the input field.) Then, insert spaces or punctuation characters as appropriate.

You'll end up with the correct format to publish the date and/or time. (The code and previews are provided in the generator.)

Date/Time Format Generator

Specify formatting (tap links below), spaces, and punctuation.

Formatting Links:

Day

Week

Month

Year

Time

Timezone

Full Date and Time

Use the generator to test various date and time formats until the preview shows you exactly what you're looking for.

It provides copy and paste code for publishing that date/time on your web page.

(This article first appeared with an issue of the Possibilities newsletter.)

Will Bontrager

Was this article helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method

All information in WillMaster Library articles is presented AS-IS.

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2024 Will Bontrager Software LLC