PHP Date Format Generator

The Problem

When it comes to working with PHP I can never remember which characters to use when formatting a date.

The frustrating thing is I know that it is simple and in some cases very logical such as d = day of the month with leading zeros but the majority of them just don’t seem to stick. In all honesty most options won’t be used all that often apart from examples such as: day, month, year etc. You get the picture.

I am mostly dealing with dates shown on a front end level on blog posts etc so normally it really is as simple as 14 January 2012:

date('d F Y');

What I have done about it

I created this a couple of months ago but actually forgot to upload it, basically I created a web based PHP Date Format Generator. Using this generator you have the ability to output the date in whichever format you like really easily. There are two way this can be achieved:

Method 1: Using already complete date formats

There are a range of pre-made date formats you can choose from. Simply click on the example you like and the code and preview at the top will be updated automatically.

Note: Selecting a complete example will replace any date code you already have. It will also clear the undo queue.

Method 2: Building your own date format

The various individual date formats are presented in a list sorted by day, month, year and time.

Simply click on the format you like and it will be updated in the code and preview section. If you have any existing formats already there, it will simply be appended allowing you to build up you preferred date output.

Note: If you are using a pre-made example from above, it will be wiped and the undo queue cleared before adding your new option.

When building your date you have an undo button in-case you make a mistake and you also have the ability to add punctuation. I have tried to make the buttons as obvious as possible, although if you are unsure what a button does, simply hover over it and a written description will be presented.

Hopefully this little web-app can come in handy for anyone else who’s mind seems to draw a blank with when dealing with dates for some reason. Funny thing is, after working on this I can now remember them much, much easier. To give it a try, click the button below:

 

PHP Date Generator

 

All the information regarding the PHP Date fomats was taken from php.net.

Pure HTML/CSS3 Accordion (No Javascript)

Outside of my work hours, social life and excessive gaming habits I don’t get all that much time to play with HTML/CSS/JS. Certainly not half as much as I would like to. Problem is, the web design industry is such a fast moving and evolving industry that you really do have to make time to [...]

Keep Reading...

Moving WordPress To A New Domain

The Problem Every time I move a WordPress website to a new domain name or url (eg: moving it from a testing site to a live site) I can always count on one thing; my ability to forget the SQL statements to update the urls. My problem isn’t so much forgetting that I have to [...]

Keep Reading...

Steam ARPC v1.0.2 Released

Just a quick update to mention that I have released the latest Steam Regional Prices Chrome Extension update as well as some website updates to go with it. If you are running the Chrome Extension you should be upgraded to v1.0.2 automatically. Updates include Chrome Extension (v1.0.2) Modified the context menu to only show the [...]

Keep Reading...

Steam Regional Prices Chrome Extension

Approximately a week ago I launched my first ever Chrome Browser Extension with an accompanying website, it is called Steam All Region Price Checker (ARPC). The purpose of this extension is to allow you to check the prices for all regions of a Steam game simultaneously without leaving the current page you are on. The [...]

Keep Reading...

So I built my new gaming desktop

…and it’s awesome. Here are some photos of the journey to becoming so awesome. The Parts I purchased all my parts from PC Case Gear over in Dingley. I simply ordered all my parts online and they came within a few days hassle free and securely wrapped. Couldn’t have been more happy.   Getting Started [...]

Keep Reading...

Guest Co-Host on Jump Jump Die

Last weeked I participated as a co-host to the awesome gaming podcast called Jump Jump Die. It was created and hosted by a friend of mine, Elliot Birch and is regularily co-hosted by Brian Thompson. The podcast is complimented with a youtube channel, facebook page and a twitter account. Jump Jump Die generally runs for [...]

Keep Reading...

Checking if the jQuery easing plugin is loaded

Lately I have been experimenting with creating jQuery plugins. For my first plugin, Bayan, I was asked to implement easing functionality in the next revision. There is a great jQuery easing plugin out there right now which is used quite regularly so I figured I would just support that instead of writing my own. The [...]

Keep Reading...