Aracılığıyla paylaş


Timestamp Class

Definition

A thin wrapper around java.util.Date that allows the JDBC API to identify this as an SQL TIMESTAMP value.

[Android.Runtime.Register("java/sql/Timestamp", DoNotGenerateAcw=true)]
public class Timestamp : Java.Util.Date
[<Android.Runtime.Register("java/sql/Timestamp", DoNotGenerateAcw=true)>]
type Timestamp = class
    inherit Date
Inheritance
Timestamp
Attributes

Remarks

A thin wrapper around java.util.Date that allows the JDBC API to identify this as an SQL TIMESTAMP value. It adds the ability to hold the SQL TIMESTAMP fractional seconds value, by allowing the specification of fractional seconds to a precision of nanoseconds. A Timestamp also provides formatting and parsing operations to support the JDBC escape syntax for timestamp values.

The precision of a Timestamp object is calculated to be either: <ul> <li>19 , which is the number of characters in yyyy-mm-dd hh:mm:ss <li> 20 + s , which is the number of characters in the yyyy-mm-dd hh:mm:ss.[fff...] and s represents the scale of the given Timestamp, its fractional seconds precision. </ul>

<B>Note:</B> This type is a composite of a java.util.Date and a separate nanoseconds value. Only integral seconds are stored in the java.util.Date component. The fractional seconds - the nanos - are separate. The Timestamp.equals(Object) method never returns true when passed an object that isn't an instance of java.sql.Timestamp, because the nanos component of a date is unknown. As a result, the Timestamp.equals(Object) method is not symmetric with respect to the java.util.Date.equals(Object) method. Also, the hashCode method uses the underlying java.util.Date implementation and therefore does not include nanos in its computation.

Due to the differences between the Timestamp class and the java.util.Date class mentioned above, it is recommended that code not view Timestamp values generically as an instance of java.util.Date. The inheritance relationship between Timestamp and java.util.Date really denotes implementation inheritance, and not type inheritance.

Java documentation for java.sql.Timestamp.

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.

Constructors

Timestamp(Int32, Int32, Int32, Int32, Int32, Int32, Int32)
Obsolete.

Constructs a Timestamp object initialized with the given values.

Timestamp(Int64)

Constructs a Timestamp object using a milliseconds time value.

Timestamp(IntPtr, JniHandleOwnership)

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

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Day
Obsolete.

Returns the day of the week represented by this date.

(Inherited from Date)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
Hours
Obsolete.

Returns the hour represented by this Date object. -or- Sets the hour of this Date object to the specified value.

(Inherited from Date)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Minutes
Obsolete.

Returns the number of minutes past the hour represented by this date, as interpreted in the local time zone. -or- Sets the minutes of this Date object to the specified value.

(Inherited from Date)
Month
Obsolete.

Returns a number representing the month that contains or begins with the instant in time represented by this Date object. -or- Sets the month of this date to the specified value.

(Inherited from Date)
Nanos

Gets this Timestamp object's nanos value. -or- Sets this Timestamp object's nanos field to the given value.

PeerReference (Inherited from Object)
Seconds
Obsolete.

Returns the number of seconds past the minute represented by this date. -or- Sets the seconds of this Date to the specified value.

(Inherited from Date)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Time

Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. -or- Sets this Date object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT.

(Inherited from Date)
TimezoneOffset
Obsolete.

Returns the offset, measured in minutes, for the local time zone relative to UTC that is appropriate for the time represented by this Date object.

(Inherited from Date)
Year
Obsolete.

Returns a value that is the result of subtracting 1900 from the year that contains or begins with the instant in time represented by this Date object, as interpreted in the local time zone. -or- Sets the year of this Date object to be the specified value plus 1900.

(Inherited from Date)

Methods

After(Date)

Tests if this date is after the specified date.

(Inherited from Date)
After(Timestamp)

Indicates whether this Timestamp object is later than the given Timestamp object.

Before(Date)

Tests if this date is before the specified date.

(Inherited from Date)
Before(Timestamp)

Indicates whether this Timestamp object is earlier than the given Timestamp object.

Clone()

Return a copy of this object.

(Inherited from Date)
CompareTo(Date)

Compares two Dates for ordering.

(Inherited from Date)
CompareTo(Timestamp)

Compares this Timestamp object to the given Timestamp object.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
Equals(Timestamp)

Tests to see if this Timestamp object is equal to the given Timestamp object.

GetDate()
Obsolete.

Returns the day of the month represented by this Date object.

(Inherited from Date)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetDate(Int32)
Obsolete.

Sets the day of the month of this Date object to the specified value.

(Inherited from Date)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToGMTString()
Obsolete.

Creates a string representation of this Date object of the form: <blockquote>

(Inherited from Date)
ToInstant()

Converts this Date object to an Instant.

(Inherited from Date)
ToLocaleString()
Obsolete.

Creates a string representation of this Date object in an implementation-dependent form.

(Inherited from Date)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
ValueOf(String)

Converts a String object in JDBC timestamp escape format to a Timestamp value.

Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IComparable.CompareTo(Object) (Inherited from Date)
IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to