Showing 179 scripts

Sort by name or size

Date.prototype Methods

Date.prototype Methods

Date instance methods for parsing, formatting, and calculating dates. 1. Parse various formats with ability to register custom formats. Ex: Date.create('Sep 20 2006'); Date.create is aliased as $D. 2. Format dates using the well-known percent-letter formatting options. Ex: $D('2006-09-20').strftime('%m/%d/%Y'); // "09/20/2006" 3. Add and subtract years, months, etc. Ex: $D('09/20/2006').add(4, 'years').strftime('%Y-%m-%d'); // "2010-09-20" 4. Calculate differences between dates in the given unit. Ex: $D('2006.09.28').diff('20 Sep, 2006', 'days'); // 8
Website:
Date.prototype Methods
Author:
Ken Snyder
Size:
4.8 KB
Last modified:
08/27/2008
License:
MIT-style Prototype License
Tags:
date & time
Rating:
3
(3/5 from 2 votes)
Your rating:
Please sign in or register to rate this script
Select multiple tags with Ctrl+click (Cmd+click on Mac)

Found a bug or have a suggestion?Let us know

bitsonnet corp · © 2007-2014 · all rights reserved

Sign In / Register / Forgot password