C# Class Jurassic.Library.DateInstance

ファイルを表示 Open project: paulbartrum/jurassic Class Usage Examples

Public Methods

Method Description
DateInstance ( ObjectInstance prototype ) : System

Creates a new Date instance and initializes it to the current time.

DateInstance ( ObjectInstance prototype, double value ) : System

Creates a new Date instance from the given date value.

DateInstance ( ObjectInstance prototype, int year, int month, int day = 1, int hour, int minute, int second, int millisecond ) : System

Creates a new Date instance from various date components, expressed in local time.

If any of the parameters are out of range, then the other values are modified accordingly.

DateInstance ( ObjectInstance prototype, string dateStr ) : System

Creates a new Date instance from the given date string.

Now ( ) : double

Returns the current date and time as the number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC.

Parse ( string dateStr ) : double

Parses a string representation of a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC.

UTC ( int year, int month, int day = 1, int hour, int minute, int second, int millisecond ) : double

Given the components of a UTC date, returns the number of milliseconds since January 1, 1970, 00:00:00 UTC to that date.

This method differs from the Date constructor in two ways: 1. The date components are specified in UTC time rather than local time. 2. A number is returned instead of a Date instance. If any of the parameters are out of range, then the other values are modified accordingly.

Private Methods

Method Description
CreatePrototype ( ScriptEngine engine, DateConstructor constructor ) : ObjectInstance

Creates the Date prototype object.

DateInstance ( ObjectInstance prototype, DateTime dateTime ) : System

Creates a new Date instance from the given date.

GetDate ( ) : double
GetDateComponent ( DateComponent component, DateTimeKind localOrUniversal ) : double

Gets a single component of this date.

GetDay ( ) : double
GetDeclarativeProperties ( ScriptEngine engine ) : List
GetFullYear ( ) : double
GetHours ( ) : double
GetMilliseconds ( ) : double
GetMinutes ( ) : double
GetMonth ( ) : double
GetNow ( ) : DateTime

Gets the current time and date.

GetSeconds ( ) : double
GetTime ( ) : double
GetTimezoneOffset ( ) : double
GetUTCDate ( ) : double
GetUTCDay ( ) : double
GetUTCFullYear ( ) : double
GetUTCHours ( ) : double
GetUTCMilliseconds ( ) : double
GetUTCMinutes ( ) : double
GetUTCMonth ( ) : double
GetUTCSeconds ( ) : double
GetYear ( ) : double
SetDate ( double day ) : double
SetDateComponents ( DateComponent firstComponent, DateTimeKind localOrUniversal ) : double

Sets one or more components of this date.

SetFullYear ( double year ) : double
SetFullYear ( double year, double month ) : double
SetFullYear ( double year, double month, double day ) : double
SetHours ( double hour ) : double
SetHours ( double hour, double minute ) : double
SetHours ( double hour, double minute, double second ) : double
SetHours ( double hour, double minute, double second, double millisecond ) : double
SetMilliseconds ( double millisecond ) : double
SetMinutes ( double minute ) : double
SetMinutes ( double minute, double second ) : double
SetMinutes ( double minute, double second, double millisecond ) : double
SetMonth ( double month ) : double
SetMonth ( double month, double day ) : double
SetSeconds ( double second ) : double
SetSeconds ( double second, double millisecond ) : double
SetTime ( double millisecond ) : double
SetUTCDate ( double day ) : double
SetUTCFullYear ( double year ) : double
SetUTCFullYear ( double year, double month ) : double
SetUTCFullYear ( double year, double month, double day ) : double
SetUTCHours ( double hour ) : double
SetUTCHours ( double hour, double minute ) : double
SetUTCHours ( double hour, double minute, double second ) : double
SetUTCHours ( double hour, double minute, double second, double millisecond ) : double
SetUTCMilliseconds ( double millisecond ) : double
SetUTCMinutes ( double minute ) : double
SetUTCMinutes ( double minute, double second ) : double
SetUTCMinutes ( double minute, double second, double millisecond ) : double
SetUTCMonth ( double month ) : double
SetUTCMonth ( double month, double day ) : double
SetUTCSeconds ( double second ) : double
SetUTCSeconds ( double second, double millisecond ) : double
SetYear ( double year ) : double
ToDateString ( ) : string
ToDateTime ( double milliseconds ) : DateTime

Converts a javascript date into a .NET date.

ToDateTime ( int year, int month, int day, int hour, int minute, int second, int millisecond, DateTimeKind kind ) : DateTime

Given the components of a date, returns the equivalent .NET date.

ToGMTString ( ) : string
ToISOString ( ) : string
ToJSDate ( DateTime dateTime ) : double

Converts a .NET date into a javascript date.

ToJSON ( ObjectInstance thisObject, string key ) : object
ToLocaleDateString ( ) : string
ToLocaleString ( ) : string
ToLocaleTimeString ( ) : string
ToPrimitive ( ScriptEngine engine, ObjectInstance thisObj, string hint ) : object
ToString ( object thisRef ) : string
ToTimeString ( ) : string
ToTimeZoneString ( DateTime dateTime ) : string

Returns a string of the form "GMT+1200 (New Zealand Standard Time)".

ToUTCString ( ) : string
ValueOf ( ) : double
__STUB__GetDate ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetDay ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetFullYear ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetHours ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetMilliseconds ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetMinutes ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetMonth ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetSeconds ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetTime ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetTimezoneOffset ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetUTCDate ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetUTCDay ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetUTCFullYear ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetUTCHours ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetUTCMilliseconds ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetUTCMinutes ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetUTCMonth ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetUTCSeconds ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__GetYear ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetDate ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetFullYear ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetHours ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetMilliseconds ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetMinutes ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetMonth ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetSeconds ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetTime ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetUTCDate ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetUTCFullYear ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetUTCHours ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetUTCMilliseconds ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetUTCMinutes ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetUTCMonth ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetUTCSeconds ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__SetYear ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToDateString ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToGMTString ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToISOString ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToJSON ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToLocaleDateString ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToLocaleString ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToLocaleTimeString ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToPrimitive ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToString ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToTimeString ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ToUTCString ( ScriptEngine engine, object thisObj, object args ) : object
__STUB__ValueOf ( ScriptEngine engine, object thisObj, object args ) : object

Method Details

DateInstance() public method

Creates a new Date instance and initializes it to the current time.
public DateInstance ( ObjectInstance prototype ) : System
prototype ObjectInstance The next object in the prototype chain.
return System

DateInstance() public method

Creates a new Date instance from the given date value.
public DateInstance ( ObjectInstance prototype, double value ) : System
prototype ObjectInstance The next object in the prototype chain.
value double The number of milliseconds since January 1, 1970, 00:00:00 UTC.
return System

DateInstance() public method

Creates a new Date instance from various date components, expressed in local time.
If any of the parameters are out of range, then the other values are modified accordingly.
public DateInstance ( ObjectInstance prototype, int year, int month, int day = 1, int hour, int minute, int second, int millisecond ) : System
prototype ObjectInstance The next object in the prototype chain.
year int The full year.
month int The month as an integer between 0 and 11 (january to december).
day int The day of the month, from 1 to 31. Defaults to 1.
hour int The number of hours since midnight, from 0 to 23. Defaults to 0.
minute int The number of minutes, from 0 to 59. Defaults to 0.
second int The number of seconds, from 0 to 59. Defaults to 0.
millisecond int The number of milliseconds, from 0 to 999. Defaults to 0.
return System

DateInstance() public method

Creates a new Date instance from the given date string.
public DateInstance ( ObjectInstance prototype, string dateStr ) : System
prototype ObjectInstance The next object in the prototype chain.
dateStr string A string representing a date, expressed in RFC 1123 format.
return System

Now() public static method

Returns the current date and time as the number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC.
public static Now ( ) : double
return double

Parse() public static method

Parses a string representation of a date, and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC.
public static Parse ( string dateStr ) : double
dateStr string A string representing a date, expressed in RFC 1123 format.
return double

UTC() public static method

Given the components of a UTC date, returns the number of milliseconds since January 1, 1970, 00:00:00 UTC to that date.
This method differs from the Date constructor in two ways: 1. The date components are specified in UTC time rather than local time. 2. A number is returned instead of a Date instance. If any of the parameters are out of range, then the other values are modified accordingly.
public static UTC ( int year, int month, int day = 1, int hour, int minute, int second, int millisecond ) : double
year int The full year.
month int The month as an integer between 0 and 11 (january to december).
day int The day of the month, from 1 to 31. Defaults to 1.
hour int The number of hours since midnight, from 0 to 23. Defaults to 0.
minute int The number of minutes, from 0 to 59. Defaults to 0.
second int The number of seconds, from 0 to 59. Defaults to 0.
millisecond int The number of milliseconds, from 0 to 999. Defaults to 0.
return double