org.sgx.j2s.html
Class Date

Package class diagram package Date
java.lang.Object
  extended by org.sgx.j2s.html.Date

public class Date
extends java.lang.Object

javascript native Date object representation


Constructor Summary
private Date()
          use JsUtils.newDate() for creating Date Objects
 
Method Summary
 int getDate()
          Returns the day of the month from a Date object (from 1-31) 1 3
 int getDay()
          Returns the day of the week from a Date object (from 0-6) 1 3
 int getFullYear()
          Returns the year, as a four-digit number, from a Date object 1 4
 int getHours()
          Returns the hour of a Date object (from 0-23) 1 3
 int getMilliseconds()
          Returns the milliseconds of a Date object (from 0-999) 1 4
 int getMinutes()
          Returns the minutes of a Date object (from 0-59) 1 3
 int getMonth()
          Returns the month from a Date object (from 0-11) 1 3
 int getSeconds()
          Returns the seconds of a Date object (from 0-59) 1 3
 int getTime()
          Returns the number of milliseconds since midnight Jan 1, 1970 1 3
 int getTimezoneOffset()
          Returns the difference in minutes between local time and Greenwich Mean Time (GMT) 1 3
 int getUTCDate()
          Returns the day of the month from a Date object according to universal time (from 1-31) 1 4
 int getUTCDay()
          Returns the day of the week from a Date object according to universal time (from 0-6) 1 4
 int getUTCFullYear()
          Returns the four-digit year from a Date object according to universal time 1 4
 int getUTCHours()
          Returns the hour of a Date object according to universal time (from 0-23) 1 4
 int getUTCMilliseconds()
          Returns the milliseconds of a Date object according to universal time (from 0-999) 1 4
 int getUTCMinutes()
          Returns the minutes of a Date object according to universal time (from 0-59) 1 4
 int getUTCMonth()
          Returns the month from a Date object according to universal time (from 0-11) 1 4
 int getUTCSeconds()
          Returns the seconds of a Date object according to universal time (from 0-59) 1 4
 int parse(java.lang.String s)
          Takes a date string and returns the number of milliseconds since midnight of January 1, 1970 1 3
 void setDate(int d)
          Sets the day of the month in a Date object (from 1-31) 1 3
 void setFullYear(int y)
          Sets the year in a Date object (four digits) 1 4
 void setHours()
          Sets the hour in a Date object (from 0-23) 1 3
 void setMilliseconds()
          Sets the milliseconds in a Date object (from 0-999) 1 4
 void setMinutes()
          Set the minutes in a Date object (from 0-59) 1 3
 void setMonth()
          Sets the month in a Date object (from 0-11) 1 3
 void setSeconds()
           
 void setTime(int t)
          Calculates a date and time by adding or subtracting a specified number of milliseconds to/from midnight January 1, 1970 1 3
 void setUTCDate(int t)
           
 void setUTCFullYear(int y)
          Sets the year in a Date object according to universal time (four digits) 1 4
 void setUTCHours(int h)
          Sets the hour in a Date object according to universal time (from 0-23) 1 4
 void setUTCMilliseconds(int t)
          Sets the milliseconds in a Date object according to universal time (from 0-999) 1 4
 void setUTCMinutes(int t)
          Set the minutes in a Date object according to universal time (from 0-59) 1 4
 void setUTCMonth(int t)
          Sets the month in a Date object according to universal time (from 0-11) 1 4
 void setUTCSeconds(int t)
          Set the seconds in a Date object according to universal time (from 0-59) 1 4
 void setYear(int t)
          Sets the year in the Date object (two or four digits).
 java.lang.String toDateString()
          Returns the date portion of a Date object in readable form
 java.lang.String toGMTString()
          Converts a Date object, according to Greenwich time, to a string.
 java.lang.String toLocaleDateString()
          Converts a Date object, according to local time, to a string and returns the date portion 1 4
 java.lang.String toLocaleString()
          Converts a Date object, according to local time, to a string 1 3
 java.lang.String toLocaleTimeString()
          Converts a Date object, according to local time, to a string and returns the time portion 1 4
 java.lang.String toSource()
          Represents the source code of an object 1 -
 java.lang.String toString()
          Converts a Date object to a string 1 4
 java.lang.String toTimeString()
          Returns the time portion of a Date object in readable form
 java.lang.String toUTCString()
          Converts a Date object, according to universal time, to a string 1 4
 int UTC(Date d)
          Takes a date and returns the number of milliseconds since midnight of January 1, 1970 according to universal time 1 3
 java.lang.Object valueOf()
          Returns the primitive value of a Date object 1 4
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Date

private Date()
use JsUtils.newDate() for creating Date Objects

Method Detail

getDate

public int getDate()
Returns the day of the month from a Date object (from 1-31) 1 3


getDay

public int getDay()
Returns the day of the week from a Date object (from 0-6) 1 3


getFullYear

public int getFullYear()
Returns the year, as a four-digit number, from a Date object 1 4


getHours

public int getHours()
Returns the hour of a Date object (from 0-23) 1 3


getMilliseconds

public int getMilliseconds()
Returns the milliseconds of a Date object (from 0-999) 1 4


getMinutes

public int getMinutes()
Returns the minutes of a Date object (from 0-59) 1 3


getMonth

public int getMonth()
Returns the month from a Date object (from 0-11) 1 3


getSeconds

public int getSeconds()
Returns the seconds of a Date object (from 0-59) 1 3


getTime

public int getTime()
Returns the number of milliseconds since midnight Jan 1, 1970 1 3


getTimezoneOffset

public int getTimezoneOffset()
Returns the difference in minutes between local time and Greenwich Mean Time (GMT) 1 3


getUTCDate

public int getUTCDate()
Returns the day of the month from a Date object according to universal time (from 1-31) 1 4


getUTCDay

public int getUTCDay()
Returns the day of the week from a Date object according to universal time (from 0-6) 1 4


getUTCMonth

public int getUTCMonth()
Returns the month from a Date object according to universal time (from 0-11) 1 4


getUTCFullYear

public int getUTCFullYear()
Returns the four-digit year from a Date object according to universal time 1 4


getUTCHours

public int getUTCHours()
Returns the hour of a Date object according to universal time (from 0-23) 1 4


getUTCMinutes

public int getUTCMinutes()
Returns the minutes of a Date object according to universal time (from 0-59) 1 4


getUTCSeconds

public int getUTCSeconds()
Returns the seconds of a Date object according to universal time (from 0-59) 1 4


getUTCMilliseconds

public int getUTCMilliseconds()
Returns the milliseconds of a Date object according to universal time (from 0-999) 1 4


parse

public int parse(java.lang.String s)
Takes a date string and returns the number of milliseconds since midnight of January 1, 1970 1 3


setDate

public void setDate(int d)
Sets the day of the month in a Date object (from 1-31) 1 3


setFullYear

public void setFullYear(int y)
Sets the year in a Date object (four digits) 1 4


setHours

public void setHours()
Sets the hour in a Date object (from 0-23) 1 3


setMilliseconds

public void setMilliseconds()
Sets the milliseconds in a Date object (from 0-999) 1 4


setMinutes

public void setMinutes()
Set the minutes in a Date object (from 0-59) 1 3


setMonth

public void setMonth()
Sets the month in a Date object (from 0-11) 1 3


setSeconds

public void setSeconds()

setTime

public void setTime(int t)
Calculates a date and time by adding or subtracting a specified number of milliseconds to/from midnight January 1, 1970 1 3


setUTCDate

public void setUTCDate(int t)

setUTCMonth

public void setUTCMonth(int t)
Sets the month in a Date object according to universal time (from 0-11) 1 4


setUTCFullYear

public void setUTCFullYear(int y)
Sets the year in a Date object according to universal time (four digits) 1 4


setUTCHours

public void setUTCHours(int h)
Sets the hour in a Date object according to universal time (from 0-23) 1 4


setUTCMinutes

public void setUTCMinutes(int t)
Set the minutes in a Date object according to universal time (from 0-59) 1 4


setUTCSeconds

public void setUTCSeconds(int t)
Set the seconds in a Date object according to universal time (from 0-59) 1 4


setUTCMilliseconds

public void setUTCMilliseconds(int t)
Sets the milliseconds in a Date object according to universal time (from 0-999) 1 4


setYear

public void setYear(int t)
Sets the year in the Date object (two or four digits). Use setFullYear() instead !! 1 3


toDateString

public java.lang.String toDateString()
Returns the date portion of a Date object in readable form


toGMTString

public java.lang.String toGMTString()
Converts a Date object, according to Greenwich time, to a string. Use toUTCString() instead !! 1 3


toLocaleDateString

public java.lang.String toLocaleDateString()
Converts a Date object, according to local time, to a string and returns the date portion 1 4


toLocaleTimeString

public java.lang.String toLocaleTimeString()
Converts a Date object, according to local time, to a string and returns the time portion 1 4


toLocaleString

public java.lang.String toLocaleString()
Converts a Date object, according to local time, to a string 1 3


toSource

public java.lang.String toSource()
Represents the source code of an object 1 -


toString

public java.lang.String toString()
Converts a Date object to a string 1 4

Overrides:
toString in class java.lang.Object

toTimeString

public java.lang.String toTimeString()
Returns the time portion of a Date object in readable form


toUTCString

public java.lang.String toUTCString()
Converts a Date object, according to universal time, to a string 1 4


UTC

public int UTC(Date d)
Takes a date and returns the number of milliseconds since midnight of January 1, 1970 according to universal time 1 3


valueOf

public java.lang.Object valueOf()
Returns the primitive value of a Date object 1 4