Timestamp Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- 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(Int64) |
Constructs a |
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 |
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 |
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 |
Month |
Obsolete.
Returns a number representing the month that contains or begins
with the instant in time represented by this |
Nanos |
Gets this |
PeerReference | (Inherited from Object) |
Seconds |
Obsolete.
Returns the number of seconds past the minute represented by this date. -or- Sets the seconds of this |
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 |
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 |
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 |
Methods
After(Date) |
Tests if this date is after the specified date. (Inherited from Date) |
After(Timestamp) |
Indicates whether this |
Before(Date) |
Tests if this date is before the specified date. (Inherited from Date) |
Before(Timestamp) |
Indicates whether this |
Clone() |
Return a copy of this object. (Inherited from Date) |
CompareTo(Date) |
Compares two Dates for ordering. (Inherited from Date) |
CompareTo(Timestamp) |
Compares this |
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 |
GetDate() |
Obsolete.
Returns the day of the month represented by this |
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 |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
ToArray<T>() | (Inherited from Object) |
ToGMTString() |
Obsolete.
Creates a string representation of this |
ToInstant() |
Converts this |
ToLocaleString() |
Obsolete.
Creates a string representation of this |
ToString() |
Returns a string representation of the object. (Inherited from Object) |
UnregisterFromRuntime() | (Inherited from Object) |
ValueOf(String) |
Converts a |
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) |