Example usage

Usage

This library may be used as follows:
     var d = new Date();

     var ymd = d.strftime('%Y/%m/%d');
     var iso = d.strftime('%Y-%m-%dT%H:%M:%S%z');

Examples

To get the current time in hours and minutes:
        var d = new Date();
        d.strftime("%H:%M");

To get the current time with seconds in AM/PM notation:

        var d = new Date();
        d.strftime("%r");

To get the year and day of the year for August 23, 2009:

        var d = new Date('2009/8/23');
        d.strftime("%Y-%j");

Demo

Try your own examples on the strftime demo page. You can use any of the supported Format specifiers.

Generated on Tue Jun 17 22:31:26 2008 for strftime by  doxygen 1.5.5