Software, your way.
How To Get Good Custom Software
(Download)
(PDF)
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!

Date and Time Formatting

The generator below creates program code to custom format date and time. It generates JavaScript, PHP, and Perl software code to print the date/time in your specified format.

The generated source code is a complete program in each of the 3 languages. The software source code may be modified. The article introducing the generator is here.

Usage notes are below the generator.

Formatted Date/Time Display Generator

Specifying the date/time format is done in 2 steps.

  1. The format for the date/time display using placeholders for month, day, hour, and so forth.

  2. The format for the placeholders themselves.

Then, copy the generated code for the programming language of your choice and paste it into your source code.

The generated program source code assumes the current date. Modify as desired.

For the Formatted Date/Time Display Generator's examples, the date/time Wednesday, September 5, 2012 at 9:02:07 is assumed.

Step 1 —

To specify the display format, use placeholders. [placeholders]

Display format:

Step 2 —

Format the placeholders: [notes]

{W} {Y} {M} {D}
{h} {m} {s} {ap}

Format displays as:

[specify preferences]

Now —

Click the link for the programming language of your choice and copy the generated source code.

[JavaScript]     [PHP]     [Perl]    

The generated code is a complete application to print the current date/time with your specified format. Modify as desired.

Usage Notes for Generated Date/Time Program Code

The generated source code is a complete application, ready to copy.

  • JavaScript — Paste it into the source code of a web page. The published date and time are according to the clock on your computer. For your site visitor's, the date/time will be according to their computer.

  • PHP — Paste it into the source code of an existing .php web page or save it as a separate .php web page. The published date and time are according to the clock on your server.

  • Perl — Save it as a .cgi or .pl file. Upload it to your server as plain text and give it 755 permissions. Type its URL into your browser or call it with an SSI tag from a .shtml web page. The published date and time are according to the clock on your server.

The generated code may be modified as needed.

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