Skip to Content | Skip to Navigation


Introduction contains methods for manipulating Javascript Date objects. The* methods are generally independent of String representations and are culturally neutral. There are two modules beneath*, for culturally neutral representations using a subset of the ISO-8601 standard, typically for unambiguous, machine-readable formatting and parsing of dates (e.g. 2008-10-16T23:59:59), and*, for culturally-sensitive formatting and parsing of dates for human interaction (e.g. in English: Thursday, October 8, 2008 11:59:59PM)

Note that in JavaScript, counting of months starts at “0” so if you want to create following date: August 23rd 2034 you will have to do:

var myDate = new Date(2034,7,23);

So don't get confused by the new Date() statements in the tests, the second parameter is the month and is always one number lower than the month you actually want.


<style type="text/css">
  @import "/_static/dojo/dojox/widget/DocTester/DocTester.css";
<script type="text/javascript">
    var docTest = new dojox.widget.DocTester({}, "docTest");
<div id="docTest">
  >>> var date1 = new Date(2000, 2, 1); date1.toUTCString(); // note that even toUTCString output is implementation-dependent
  "Wed, 01 Mar 2000 05:00:00 GMT"
  >>> var date2 =, "month", -1); date2.toUTCString();
  "Tue, 01 Feb 2000 05:00:00 GMT"
  >>>, date2, "day")