Package ch.bailu.gtk.glib
Klasse TimeVal
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.glib.TimeVal
- Alle implementierten Schnittstellen:
PointerInterface
Represents a precise time, with seconds and microseconds.
Similar to the struct timeval returned by the `gettimeofday()`
UNIX system call.
GLib is attempting to unify around the use of 64-bit integers to
represent microsecond-precision time. As such, this type will be
removed from a future version of GLib. A consequence of using `glong` for
`tv_sec` is that on 32-bit systems `GTimeVal` is subject to the year 2038
problem.
Similar to the struct timeval returned by the `gettimeofday()`
UNIX system call.
GLib is attempting to unify around the use of 64-bit integers to
represent microsecond-precision time. As such, this type will be
removed from a future version of GLib. A consequence of using `glong` for
`tv_sec` is that on 32-bit systems `GTimeVal` is subject to the year 2038
problem.
-
Feldübersicht
Felder -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
add
(long microseconds) Veraltet.static boolean
fromIso8601
(Str iso_date, TimeVal time_) Veraltet.static ClassHandler
long
secondslong
microsecondsvoid
setFieldTvSec
(long tv_sec) secondsvoid
setFieldTvUsec
(long tv_usec) microsecondsVeraltet.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
TV_SEC
seconds- Siehe auch:
-
TV_USEC
microseconds- Siehe auch:
-
-
Konstruktordetails
-
TimeVal
-
TimeVal
public TimeVal()
-
-
Methodendetails
-
getClassHandler
-
setFieldTvSec
public void setFieldTvSec(long tv_sec) seconds -
getFieldTvSec
public long getFieldTvSec()seconds -
setFieldTvUsec
public void setFieldTvUsec(long tv_usec) microseconds -
getFieldTvUsec
public long getFieldTvUsec()microseconds -
add
Veraltet.Adds the given number of microseconds to @time_. @microseconds can
also be negative to decrease the value of @time_.- Parameter:
microseconds
- number of microseconds to add to @time
-
toIso8601
Veraltet.Converts @time_ into an RFC 3339 encoded string, relative to the
Coordinated Universal Time (UTC). This is one of the many formats
allowed by ISO 8601.
ISO 8601 allows a large number of date/time formats, with or without
punctuation and optional elements. The format returned by this function
is a complete date and time, with optional punctuation included, the
UTC time zone represented as "Z", and the @tv_usec part included if
and only if it is nonzero, i.e. either
"YYYY-MM-DDTHH:MM:SSZ" or "YYYY-MM-DDTHH:MM:SS.fffffZ".
This corresponds to the Internet date/time format defined by
[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt),
and to either of the two most-precise formats defined by
the W3C Note
[Date and Time Formats](http://www.w3.org/TR/NOTE-datetime-19980827).
Both of these documents are profiles of ISO 8601.
Use g_date_time_format() or g_strdup_printf() if a different
variation of ISO 8601 format is required.
If @time_ represents a date which is too large to fit into a `struct tm`,
%NULL will be returned. This is platform dependent. Note also that since
`GTimeVal` stores the number of seconds as a `glong`, on 32-bit systems it
is subject to the year 2038 problem. Accordingly, since GLib 2.62, this
function has been deprecated. Equivalent functionality is available using:GDateTime *dt = g_date_time_new_from_unix_utc (time_val); iso8601_string = g_date_time_format_iso8601 (dt); g_date_time_unref (dt);
The return value of g_time_val_to_iso8601() has been nullable since GLib
2.54; before then, GLib would crash under the same conditions.- Gibt zurück:
- a newly allocated string containing an ISO 8601 date, or %NULL if @time_ was too large
-
fromIso8601
Veraltet.Converts a string containing an ISO 8601 encoded date and time
to a #GTimeVal and puts it into @time_.
@iso_date must include year, month, day, hours, minutes, and
seconds. It can optionally include fractions of a second and a time
zone indicator. (In the absence of any time zone indication, the
timestamp is assumed to be in local time.)
Any leading or trailing space in @iso_date is ignored.
This function was deprecated, along with #GTimeVal itself, in GLib 2.62.
Equivalent functionality is available using code like:GDateTime *dt = g_date_time_new_from_iso8601 (iso8601_string, NULL); gint64 time_val = g_date_time_to_unix (dt); g_date_time_unref (dt);
- Parameter:
iso_date
- an ISO 8601 encoded date stringtime_
- a #GTimeVal- Gibt zurück:
- %TRUE if the conversion was successful.
-