gi-glib-2.0.12: GLib bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GLib.Structs.TimeVal

Contents

Description

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 64bit integers to represent microsecond-precision time. As such, this type will be removed from a future version of GLib.

Synopsis

Exported types

newtype TimeVal Source #

Constructors

TimeVal (ManagedPtr TimeVal) 

Instances

WrappedPtr TimeVal Source # 
(~) AttrOpTag tag AttrSet => Constructible TimeVal tag Source # 

Methods

new :: MonadIO m => (ManagedPtr TimeVal -> TimeVal) -> [AttrOp TimeVal tag] -> m TimeVal #

((~) * info (ResolveTimeValMethod t TimeVal), MethodInfo * info TimeVal p) => IsLabel t (TimeVal -> p) Source # 

Methods

fromLabel :: Proxy# Symbol t -> TimeVal -> p #

((~) * info (ResolveTimeValMethod t TimeVal), MethodInfo * info TimeVal p) => IsLabelProxy t (TimeVal -> p) Source # 

Methods

fromLabelProxy :: Proxy Symbol t -> TimeVal -> p #

HasAttributeList * TimeVal Source # 
((~) * signature (m Text), MonadIO m) => MethodInfo * TimeValToIso8601MethodInfo TimeVal signature Source # 
((~) * signature (CLong -> m ()), MonadIO m) => MethodInfo * TimeValAddMethodInfo TimeVal signature Source # 
type AttributeList TimeVal Source # 

newZeroTimeVal :: MonadIO m => m TimeVal Source #

Construct a TimeVal struct initialized to zero.

Methods

add

data TimeValAddMethodInfo Source #

Instances

((~) * signature (CLong -> m ()), MonadIO m) => MethodInfo * TimeValAddMethodInfo TimeVal signature Source # 

timeValAdd Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TimeVal

time_: a TimeVal

-> CLong

microseconds: number of microseconds to add to time

-> m () 

Adds the given number of microseconds to time_. microseconds can also be negative to decrease the value of time_.

fromIso8601

timeValFromIso8601 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

isoDate: an ISO 8601 encoded date string

-> m (Bool, TimeVal)

Returns: True if the conversion was successful.

Converts a string containing an ISO 8601 encoded date and time to a TimeVal and puts it into time_.

isoDate 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.)

Since: 2.12

toIso8601

timeValToIso8601 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> TimeVal

time_: a TimeVal

-> m Text

Returns: a newly allocated string containing an ISO 8601 date

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 tvUsec 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, and to either of the two most-precise formats defined by the W3C Note Date and Time Formats. Both of these documents are profiles of ISO 8601.

Use dateTimeFormat or g_strdup_printf() if a different variation of ISO 8601 format is required.

Since: 2.12

Properties

tvSec

tvUsec