The jQuery Date Format plugin enables the formatting and parsing of dates.
Switch branches/tags
Nothing to show
Pull request Compare This branch is 184 commits behind phstc:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
README
Test.html
jquery-1.4.min.js
jquery.dateFormat-1.0.js

README

http://plugins.jquery.com/project/jquery-dateFormat

The jQuery Date Format plugin enables the formatting and parsing of dates.

Format with css class name
<code>
<span class="shortDateFormat">2009-12-18 10:54:50.546</span>
<span class="longDateFormat">2009-12-18 10:54:50.546</span>
</code>

output
#1 18/12/2009
#2 18/12/2009 10:54:50

Format with javascript
<code>
<script>
$.format.date("2009-12-18 10:54:50.546", "dd/MM/yyyy");
</script>
</code>

input dates formats
#1 2009-12-18 10:54:50.546
#2 Wed Jan 13 10:43:41 CET 2010

date and time patterns
yyyy = year
MM = month
dd = day
hh = hour in am/pm (1-12)
HH = hour in day (0-23) 
mm = minute
ss = second
a  = Am/pm marker 

Examples
<code>
<script>
document.write($.format.date("2009-12-18 10:54:50.546", "Test: dd/MM/yyyy"));
document.write($.format.date("Wed Jan 13 10:43:41 CET 2010", "dd~MM~yyyy"));
</script>
</code>

output
#1 Test: 18/12/2009
#2 18~12~2009

The css class names patterns by default are
shortDateFormat = dd/MM/yyyy
longDateFormat = dd/MM/yyyy hh:mm:ss

You can change the patterns in jquery.dateFormat