Condividi tramite


Time.GetJulianDay(Int64, Int64) Method

Definition

Computes the Julian day number for a point in time in a particular timezone.

[Android.Runtime.Register("getJulianDay", "(JJ)I", "")]
public static int GetJulianDay (long millis, long gmtoffSeconds);
[<Android.Runtime.Register("getJulianDay", "(JJ)I", "")>]
static member GetJulianDay : int64 * int64 -> int

Parameters

millis
Int64

the time in UTC milliseconds

gmtoffSeconds
Int64

the offset from UTC in seconds

Returns

the Julian day

Attributes

Remarks

Computes the Julian day number for a point in time in a particular timezone. The Julian day for a given calendar date is the same for every timezone. For example, the Julian day for July 1, 2008 is 2454649.

Callers must pass the time in UTC millisecond (as can be returned by #toMillis(boolean) or #normalize(boolean)) and the offset from UTC of the timezone in seconds at that time (as might be in #gmtoff).

The Julian day is useful for testing if two events occur on the same calendar date and for determining the relative time of an event from the present ("yesterday", "3 days ago", etc.).

This member is deprecated. Use java.time.temporal.JulianFields#JULIAN_DAY instead.

Java documentation for android.text.format.Time.getJulianDay(long, 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