Freigeben über


Date Constructors

Definition

Overloads

Date()

Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.

Date(Int64)

Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.

Date(String)
Obsolete.

Allocates a Date object and initializes it so that it represents the date and time indicated by the string s, which is interpreted as if by the Date#parse method.

Date(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Date(Int32, Int32, Int32)
Obsolete.

Allocates a Date object and initializes it so that it represents midnight, local time, at the beginning of the day specified by the year, month, and date arguments.

Date(Int32, Int32, Int32, Int32, Int32)
Obsolete.

Allocates a Date object and initializes it so that it represents the instant at the start of the minute specified by the year, month, date, hrs, and min arguments, in the local time zone.

Date(Int32, Int32, Int32, Int32, Int32, Int32)
Obsolete.

Allocates a Date object and initializes it so that it represents the instant at the start of the second specified by the year, month, date, hrs, min, and sec arguments, in the local time zone.

Date()

Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.

[Android.Runtime.Register(".ctor", "()V", "")]
public Date ();
Attributes

Remarks

Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.

Java documentation for java.util.Date.Date().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Date(Int64)

Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.

[Android.Runtime.Register(".ctor", "(J)V", "")]
public Date (long date);
[<Android.Runtime.Register(".ctor", "(J)V", "")>]
new Java.Util.Date : int64 -> Java.Util.Date

Parameters

date
Int64

the milliseconds since January 1, 1970, 00:00:00 GMT.

Attributes

Remarks

Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.

Java documentation for java.util.Date.Date(long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Date(String)

Caution

deprecated

Allocates a Date object and initializes it so that it represents the date and time indicated by the string s, which is interpreted as if by the Date#parse method.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")]
[System.Obsolete("deprecated")]
public Date (string? s);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")>]
[<System.Obsolete("deprecated")>]
new Java.Util.Date : string -> Java.Util.Date

Parameters

s
String

a string representation of the date.

Attributes

Remarks

Allocates a Date object and initializes it so that it represents the date and time indicated by the string s, which is interpreted as if by the Date#parse method.

This member is deprecated. As of JDK version 1.1, replaced by DateFormat.parse(String s).

Java documentation for java.util.Date.Date(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Date(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected Date (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Util.Date : nativeint * Android.Runtime.JniHandleOwnership -> Java.Util.Date

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Date(Int32, Int32, Int32)

Caution

deprecated

Allocates a Date object and initializes it so that it represents midnight, local time, at the beginning of the day specified by the year, month, and date arguments.

[Android.Runtime.Register(".ctor", "(III)V", "")]
[System.Obsolete("deprecated")]
public Date (int year, int month, int date);
[<Android.Runtime.Register(".ctor", "(III)V", "")>]
[<System.Obsolete("deprecated")>]
new Java.Util.Date : int * int * int -> Java.Util.Date

Parameters

year
Int32

the year minus 1900.

month
Int32

the month between 0-11.

date
Int32

the day of the month between 1-31.

Attributes

Remarks

Allocates a Date object and initializes it so that it represents midnight, local time, at the beginning of the day specified by the year, month, and date arguments.

This member is deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date) or GregorianCalendar(year + 1900, month, date).

Java documentation for java.util.Date.Date(int, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Date(Int32, Int32, Int32, Int32, Int32)

Caution

deprecated

Allocates a Date object and initializes it so that it represents the instant at the start of the minute specified by the year, month, date, hrs, and min arguments, in the local time zone.

[Android.Runtime.Register(".ctor", "(IIIII)V", "")]
[System.Obsolete("deprecated")]
public Date (int year, int month, int date, int hrs, int min);
[<Android.Runtime.Register(".ctor", "(IIIII)V", "")>]
[<System.Obsolete("deprecated")>]
new Java.Util.Date : int * int * int * int * int -> Java.Util.Date

Parameters

year
Int32

the year minus 1900.

month
Int32

the month between 0-11.

date
Int32

the day of the month between 1-31.

hrs
Int32

the hours between 0-23.

min
Int32

the minutes between 0-59.

Attributes

Remarks

Allocates a Date object and initializes it so that it represents the instant at the start of the minute specified by the year, month, date, hrs, and min arguments, in the local time zone.

This member is deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min) or GregorianCalendar(year + 1900, month, date, hrs, min).

Java documentation for java.util.Date.Date(int, int, int, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Date(Int32, Int32, Int32, Int32, Int32, Int32)

Caution

deprecated

Allocates a Date object and initializes it so that it represents the instant at the start of the second specified by the year, month, date, hrs, min, and sec arguments, in the local time zone.

[Android.Runtime.Register(".ctor", "(IIIIII)V", "")]
[System.Obsolete("deprecated")]
public Date (int year, int month, int date, int hrs, int min, int sec);
[<Android.Runtime.Register(".ctor", "(IIIIII)V", "")>]
[<System.Obsolete("deprecated")>]
new Java.Util.Date : int * int * int * int * int * int -> Java.Util.Date

Parameters

year
Int32

the year minus 1900.

month
Int32

the month between 0-11.

date
Int32

the day of the month between 1-31.

hrs
Int32

the hours between 0-23.

min
Int32

the minutes between 0-59.

sec
Int32

the seconds between 0-59.

Attributes

Remarks

Allocates a Date object and initializes it so that it represents the instant at the start of the second specified by the year, month, date, hrs, min, and sec arguments, in the local time zone.

This member is deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min, sec) or GregorianCalendar(year + 1900, month, date, hrs, min, sec).

Java documentation for java.util.Date.Date(int, int, int, int, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to