Introducing the Date and Time Formatting Generator
Do you print dates on your web pages?
If yes, the new Date and Time Generator is for you.
It's for me, too. The generator is something I've wanted for myself for many months. It will save me time otherwise spent finding certain snippets of code on my hard drive.
Some people like to publish the day of the week with the dates, spelled out or abbreviated. Some like to format the date as day-month-year, others as month-day-year. Some like slashes between date elements, some like periods, others hyphens.
Some like to publish the time along with the date, or the time by itself. Some like to publish the time with seconds, some without. Other preferences are 24-hour format or 12-hour format with AM/PM.
All those preferences are available with the Date and Time Generator.
JavaScript, PHP, Perl — which programming language do you prefer?
The Date and Time Generator generates the source code to print the current date and/or time according to your stated preference in all three languages.
-
Specify your date/time format preference.
-
Copy the generated source code for the language you prefer — JavaScript, PHP,
or Perl.
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.
If you print dates on your web pages, give the Date and Time Generator a try.
Click here to use the generator.
Will Bontrager