Show / Hide Table of Contents

Class RawTime

An immutable time value.

Inheritance
object
RawTime
Inherited Members
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.IO.Pof
Assembly: Coherence.dll
Syntax
public class RawTime

Constructors

RawTime(int, int, int, int, bool)

Constructs a raw POF time value.

Declaration
public RawTime(int hour, int minute, int second, int nanosecond, bool isUTC)
Parameters
Type Name Description
int hour

The hours (0 through 23).

int minute

The minutes (0 through 59).

int second

The seconds (0 through 59).

int nanosecond

The nanoseconds (0 through 999999999).

bool isUTC

true if the time value is UTC or false if the time value does not have an explicit time zone.

RawTime(int, int, int, int, int, int)

Construct a raw POF time value with a timezone.

Declaration
public RawTime(int hour, int minute, int second, int nanosecond, int hourOffset, int minuteOffset)
Parameters
Type Name Description
int hour

The hours (0 through 23).

int minute

The minutes (0 through 59).

int second

The seconds (0 through 59).

int nanosecond

The nanoseconds (0 through 999999999).

int hourOffset

The timezone offset in hours from UTC, for example 0 for BST, -5 for EST and 1 for CET.

int minuteOffset

The timezone offset in minutes, for example 0 (in most cases) or 30.

Properties

HasTimezone

Determine if the time value has an explicit timezone.

Declaration
public bool HasTimezone { get; }
Property Value
Type Description
bool

true iff the time has an explicit timezone.

Remarks

A time value without an explicit timezone is assumed to be in some conventional local timezone, according to ISO8601.

Hour

Determine the time's hour value.

Declaration
public int Hour { get; }
Property Value
Type Description
int

The hour between 0 and 23 inclusive.

HourOffset

Determine the timezone's hour offset value.

Declaration
public int HourOffset { get; }
Property Value
Type Description
int

The hour offset of the timezeone, or zero if there is no explicit timezone or the time is UTC.

IsUtc

Determine if the time value uses UTC.

Declaration
public bool IsUtc { get; }
Property Value
Type Description
bool

true if the time value is a UTC value.

Minute

Determine the time's minute value.

Declaration
public int Minute { get; }
Property Value
Type Description
int

The minute between 0 and 23 inclusive.

MinuteOffset

Determine the timezone's minute offset value.

Declaration
public int MinuteOffset { get; }
Property Value
Type Description
int

The minute offset of the timezeone, or zero if there is no explicit timezone or the time is UTC.

Nanosecond

Determine the time's nanosecond value.

Declaration
public int Nanosecond { get; }
Property Value
Type Description
int

The nanosecond value between 0 and 999999999 inclusive.

Second

Determine the time's second value.

Declaration
public int Second { get; }
Property Value
Type Description
int

The second value between 0 and 59 inclusive.

Methods

Equals(object)

Compare this object with another for equality.

Declaration
public override bool Equals(object o)
Parameters
Type Name Description
object o

Another object to compare to for equality.

Returns
Type Description
bool

true iff this object is equal to the other object.

Overrides
object.Equals(object)

GetHashCode()

Obtain the hashcode for this object.

Declaration
public override int GetHashCode()
Returns
Type Description
int

An integer hashcode.

Overrides
object.GetHashCode()

ToDateTime()

Converts this instance into a DateTime representation, ignoring any time zone information if present.

Declaration
public DateTime ToDateTime()
Returns
Type Description
DateTime

A DateTime object based on this instance.

ToLocalTime()

Converts this instance into a local DateTime representation.

Declaration
public DateTime ToLocalTime()
Returns
Type Description
DateTime

A local DateTime object based on this instance.

ToString()

Format this object's data as a human-readable string.

Declaration
public override string ToString()
Returns
Type Description
string

A string description of this object.

Overrides
object.ToString()

ToUniversalTime()

Converts this instance into a Coordinated Universal Time (UTC) DateTime representation.

Declaration
public DateTime ToUniversalTime()
Returns
Type Description
DateTime

A UTC DateTime object based on this instance.

In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.