| w3Utils Reference |
Reference
Methods |
|
| |
|
Converts a dateTime to a
GMT stringvar aDate = new Date(); var gmtDate = DateUtils.DateTimeToGMT( aDate.getVarDate() ); // gmtDate gets something like: 'Tue, 8 Dec 1998 09:59:16 +0100' |
|
| |
|
Formats a dateTime using
a user defined mask.var dateFormatted = DateUtils.FormatDateTime( "yyyy-mm-dd hh:mm", aDate.getVarDate() ); // note usage of getVarDate() |
|
| |
|
Returns the offset from
GMTvar gmtOffset = DateUtils.GetGMTOffset(); |
|
| |
|
Returns the 'name' of the
current timezonevar timeZone = DateUtils.GetTimeZone(); // returns '+0100' for example |
|
| |
|
Converts a GMT string to
DateTimevar aDateTime = DateUtils.GMTToDateTime( gmtDate ); // returns something like: '12/8/98 10:02:30 AM' |
|
| |
|
Increases the given date
(dtDate) with dwCount number of daysvar aDate = new Date(); var inTwoDays = new Date( DateUtils.IncDay( aDate.getVarDate(), 2 ) ); // note the usage of getVarDate() |
|
| |
|
Increases the given date
(dtDate) with dwCount number of monthsvar aDate = new Date(); var inTwoMonths = new Date( DateUtils.IncMonth( aDate.getVarDate(), 2 ) ); // note the usage of getVarDate() |
|
| |
|
Increases the given date
(dtDate) with dwCount number of weeksvar aDate = new Date(); var inTwoWeeks = new Date( DateUtils.IncWeek( aDate.getVarDate(), 2 ) ); // note the usage of getVarDate() |
|
| |
|
Increases the given date
(dtDate) with dwCount number of yearsvar aDate = new Date(); var inTwoYears = new Date( DateUtils.IncYear( aDate.getVarDate(), 2 ) ); // note the usage of getVarDate() |
|
| |
|
| Returns the week number
given a date. Using the week number is very common for planning purposes in for example Sweden, whereas it is virtually a nonexistant practice in the US. This can be seen in the absence of week numbering in US calendars and the usage of such nunbering in Swedish calendars. var aDate = new Date(); var theWeek = DateUtils.WeekByDate( aDate.getVarDate() ); // note the usage of getVarDate() |