libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
GblDateTime Struct Reference

#include <gimbal_date_time.h>

Inheritance diagram for GblDateTime:
gbl::DateTime

Data Fields

GblDate date
 
GblTime time
 
int16_t utcOffset
 

Related Symbols

(Note that these are not member symbols.)

Read Accessors

Methods for getting values

GblBool GblDateTime_isValid (const GblDateTime *pSelf)
 
GblBool GblDateTime_isUtc (const GblDateTime *pSelf)
 
GblBool GblDateTime_isLocal (const GblDateTime *pSelf)
 
Dynamic Lifetime

Methods for managing shared references

GblDateTimeGblDateTime_create (GblYear year, GblMonth month, GblDay day, GblHour hours, GblMinute mins, GblSecond secs, GblNanoSecond ns, GblSecond tzOff)
 
GblDateTimeGblDateTime_ref (GblDateTime *pDt)
 
GblRefCount GblDateTime_unref (GblDateTime *pDt)
 
Initialization

Methods for constructing and populating

GblDateTimeGblDateTime_fromUnix (GblDateTime *pSelf, time_t epoch)
 
GblDateTimeGblDateTime_fromSpecUtc (GblDateTime *pSelf, const GblTimeSpec *pSpec)
 
GblDateTimeGblDateTime_fromLocal (GblDateTime *pSelf, const struct tm *pLocal)
 
GblDateTimeGblDateTime_fromUtc (GblDateTime *pSelf, const struct tm *pUtc)
 
GblDateTimeGblDateTime_nowLocal (GblDateTime *pSelf)
 
GblDateTimeGblDateTime_nowUtc (GblDateTime *pSelf)
 
GblDateTimeGblDateTime_parse (GblDateTime *pSelf, const char *pString, const char *pFormat)
 
Conversions

Methods for converting to another format

time_t GblDateTime_toUnix (const GblDateTime *pSelf)
 
GblTimeSpec GblDateTime_toSpecUtc (const GblDateTime *pSelf)
 
GBL_RESULT GblDateTime_toLocal (const GblDateTime *pSelf, struct tm *pTm)
 
GBL_RESULT GblDateTime_toUtc (const GblDateTime *pSelf, struct tm *pTm)
 
const char * GblDateTime_toIso8601 (const GblDateTime *pSelf, GblStringBuffer *pBuff)
 
const char * GblDateTime_format (const GblDateTime *pSelf, GblStringBuffer *pBuffer, const char *pFmt)
 
Write Accessors

Methods for writing values

GblDateTimeGblDateTime_normalize (GblDateTime *pSelf)
 
void GblDateTime_setDate (GblDateTime *pSelf, const GblDate *pDate)
 
void GblDateTime_setTime (GblDateTime *pSelf, const GblTime *pTime)
 
GblDateTimeGblDateTime_set (GblDateTime *pSelf, GblYear year, GblMonth month, GblDay day, GblHour hours, GblMinute mins, GblSecond secs, GblNanoSecond ns, GblSecond tzOff)
 
Operators

Methods implementing operations

int GblDateTime_compare (const GblDateTime *pSelf, const GblDateTime *pRhs)
 
GblBool GblDateTime_equals (const GblDateTime *pSelf, const GblDateTime *pRhs)
 
GblTimeSpec GblDateTime_diff (const GblDateTime *pSelf, const GblDateTime *pRhs)
 
GblDateTimeGblDateTime_add (GblDateTime *pSelf, const GblDateTime *pRhs)
 
GblDateTimeGblDateTime_addDays (GblDateTime *pSelf, GblDay days)
 
GblDateTimeGblDateTime_addHours (GblDateTime *pSelf, GblHour hours)
 
GblDateTimeGblDateTime_addMinutes (GblDateTime *pSelf, GblMinute minutes)
 
GblDateTimeGblDateTime_addSeconds (GblDateTime *pSelf, GblSecond seconds)
 
GblDateTimeGblDateTime_addMilliSecs (GblDateTime *pSelf, int mSecs)
 
GblDateTimeGblDateTime_addMicroSecs (GblDateTime *pSelf, int uSecs)
 
GblDateTimeGblDateTime_addNanoSecs (GblDateTime *pSelf, GblNanoSecond nSecs)
 
GblDateTimeGblDateTime_addWeeks (GblDateTime *pSelf, int weeks)
 
GblDateTimeGblDateTime_addMonths (GblDateTime *pSelf, int months)
 
GblDateTimeGblDateTime_addYears (GblDateTime *pSelf, GblYear years)
 

Detailed Description

Represents a combined calendar date with time-of-day.

Definition at line 134 of file gimbal_date_time.h.

Friends And Related Symbol Documentation

◆ GblDateTime_isValid()

GblBool GblDateTime_isValid ( const GblDateTime pSelf)
related

Returns GBL_TRUE if the given GblDateTime structure contains both a valid date and time.

◆ GblDateTime_isUtc()

GblBool GblDateTime_isUtc ( const GblDateTime pSelf)
related

Returns GBL_TRUE if the given date/time represents a date and time within the UTC timezone.

◆ GblDateTime_isLocal()

GblBool GblDateTime_isLocal ( const GblDateTime pSelf)
related

Returns GBL_TRUE if the given date/time represents a date and time in the local timezone.

◆ GblDateTime_create()

GblDateTime * GblDateTime_create ( GblYear  year,
GblMonth  month,
GblDay  day,
GblHour  hours,
GblMinute  mins,
GblSecond  secs,
GblNanoSecond  ns,
GblSecond  tzOff 
)
related

Creates and allocates a new shared reference to a GblDateTime.

◆ GblDateTime_ref()

GblDateTime * GblDateTime_ref ( GblDateTime pDt)
related

Returns a newly acquired reference to the given GblDateTime structure.

◆ GblDateTime_unref()

GblRefCount GblDateTime_unref ( GblDateTime pDt)
related

Decrements the refCounter by 1, destroying the struct at 0, and returning the new refCount value.

◆ GblDateTime_fromUnix()

GblDateTime * GblDateTime_fromUnix ( GblDateTime pSelf,
time_t  epoch 
)
related

Sets the given date/time structure from a unix epoch time, returning a pointer to it.

◆ GblDateTime_fromSpecUtc()

GblDateTime * GblDateTime_fromSpecUtc ( GblDateTime pSelf,
const GblTimeSpec pSpec 
)
related

Sets the given date/time from a GblTimeSpec value, returning a pointer to it.

◆ GblDateTime_fromLocal()

GblDateTime * GblDateTime_fromLocal ( GblDateTime pSelf,
const struct tm *  pLocal 
)
related

Sets the given date/time from a local broken-down time, returning a pointer to it.

◆ GblDateTime_fromUtc()

GblDateTime * GblDateTime_fromUtc ( GblDateTime pSelf,
const struct tm *  pUtc 
)
related

Sets the given date/time from a UTC broken-down time, returning a pointer to it.

◆ GblDateTime_nowLocal()

GblDateTime * GblDateTime_nowLocal ( GblDateTime pSelf)
related

Sets the given date/time to the current local time, returning a pointer to it.

◆ GblDateTime_nowUtc()

GblDateTime * GblDateTime_nowUtc ( GblDateTime pSelf)
related

Sets the given date/time to the current UTC time, returning a pointer to it.

◆ GblDateTime_parse()

GblDateTime * GblDateTime_parse ( GblDateTime pSelf,
const char *  pString,
const char *  pFormat 
)
related

Parses the given string using the strptime() formatter, storing and returning pSelf.

◆ GblDateTime_toUnix()

time_t GblDateTime_toUnix ( const GblDateTime pSelf)
related

Converts the given GblDateTime to a unix epoch time.

◆ GblDateTime_toSpecUtc()

GblTimeSpec GblDateTime_toSpecUtc ( const GblDateTime pSelf)
related

Converts the given GblDateTime to a timespec UTC time.

◆ GblDateTime_toLocal()

GBL_RESULT GblDateTime_toLocal ( const GblDateTime pSelf,
struct tm *  pTm 
)
related

Converts the given GblDateTime to a broken-down local time.

◆ GblDateTime_toUtc()

GBL_RESULT GblDateTime_toUtc ( const GblDateTime pSelf,
struct tm *  pTm 
)
related

Converts the given GblDateTime to a broken-down UTC time.

◆ GblDateTime_toIso8601()

const char * GblDateTime_toIso8601 ( const GblDateTime pSelf,
GblStringBuffer pBuff 
)
related

Fills in the given buffer with the ISO8601 representation of the given date/time, return its C string.

◆ GblDateTime_format()

const char * GblDateTime_format ( const GblDateTime pSelf,
GblStringBuffer pBuffer,
const char *  pFmt 
)
related

Fills in the given buffer with the strftime()-formatted GblDateTime, returning its C string.

◆ GblDateTime_normalize()

GblDateTime * GblDateTime_normalize ( GblDateTime pSelf)
related

Ensures all values within the given GblDateTime are within range and returns a pointer to it.

◆ GblDateTime_setDate()

void GblDateTime_setDate ( GblDateTime pSelf,
const GblDate pDate 
)
related

Sets the GblDate value of the given GblDateTime to pDate.

◆ GblDateTime_setTime()

void GblDateTime_setTime ( GblDateTime pSelf,
const GblTime pTime 
)
related

Sets the GblTime value of the given GblDateTime to pTime.

◆ GblDateTime_set()

GblDateTime * GblDateTime_set ( GblDateTime pSelf,
GblYear  year,
GblMonth  month,
GblDay  day,
GblHour  hours,
GblMinute  mins,
GblSecond  secs,
GblNanoSecond  ns,
GblSecond  tzOff 
)
related

Sets the values of the given GblDateTime, with default argument values provided.

◆ GblDateTime_compare()

int GblDateTime_compare ( const GblDateTime pSelf,
const GblDateTime pRhs 
)
related

Lexacographically compares the two GblDateTimes, returning 0, -1, or 1.

◆ GblDateTime_equals()

GblBool GblDateTime_equals ( const GblDateTime pSelf,
const GblDateTime pRhs 
)
related

Returns GBL_TRUE if the two provided GblDateTimes have the same value.

◆ GblDateTime_diff()

GblTimeSpec GblDateTime_diff ( const GblDateTime pSelf,
const GblDateTime pRhs 
)
related

Returns the NS-resolution GblTimeSpec difference between two GblDateTime values.

◆ GblDateTime_add()

GblDateTime * GblDateTime_add ( GblDateTime pSelf,
const GblDateTime pRhs 
)
related

Adds the pRhs GblDateTime to pSelf, returning a pointer to pSelf.

◆ GblDateTime_addDays()

GblDateTime * GblDateTime_addDays ( GblDateTime pSelf,
GblDay  days 
)
related

Adds the given number of days to the given GblDateTime, returning a pointer to it.

◆ GblDateTime_addHours()

GblDateTime * GblDateTime_addHours ( GblDateTime pSelf,
GblHour  hours 
)
related

Adds the given number of hours to the given GblDateTime, returning a pointer to it.

◆ GblDateTime_addMinutes()

GblDateTime * GblDateTime_addMinutes ( GblDateTime pSelf,
GblMinute  minutes 
)
related

Adds the given number of minutes to the given GblDateTime, returning a pointer to it.

◆ GblDateTime_addSeconds()

GblDateTime * GblDateTime_addSeconds ( GblDateTime pSelf,
GblSecond  seconds 
)
related

Adds the given number of seconds to the given GblDateTime, returning a pointer to it.

◆ GblDateTime_addMilliSecs()

GblDateTime * GblDateTime_addMilliSecs ( GblDateTime pSelf,
int  mSecs 
)
related

Adds the given number of milliseconds to the given GblDateTime, returning a pointer to it.

◆ GblDateTime_addMicroSecs()

GblDateTime * GblDateTime_addMicroSecs ( GblDateTime pSelf,
int  uSecs 
)
related

Adds the given number of microseconds to the given GblDateTime, returning a pointer to it.

◆ GblDateTime_addNanoSecs()

GblDateTime * GblDateTime_addNanoSecs ( GblDateTime pSelf,
GblNanoSecond  nSecs 
)
related

Adds the given number of nanoseconds s to the given GblDateTime, returning a pointer to it.

◆ GblDateTime_addWeeks()

GblDateTime * GblDateTime_addWeeks ( GblDateTime pSelf,
int  weeks 
)
related

Adds the given number of weeks to the given GblDateTime, returning a pointer to it.

◆ GblDateTime_addMonths()

GblDateTime * GblDateTime_addMonths ( GblDateTime pSelf,
int  months 
)
related

Adds the given number of months to the given GblDateTime, returning a pointer to it.

◆ GblDateTime_addYears()

GblDateTime * GblDateTime_addYears ( GblDateTime pSelf,
GblYear  years 
)
related

Adds the given number of years to the given GblDateTime, returning a pointer to it.

Field Documentation

◆ date

GblDate GblDateTime::date

Date structure.

Definition at line 135 of file gimbal_date_time.h.

◆ time

GblTime GblDateTime::time

Time structure.

Definition at line 136 of file gimbal_date_time.h.

◆ utcOffset

int16_t GblDateTime::utcOffset

Timezone second offset from UTC.

Definition at line 137 of file gimbal_date_time.h.


The documentation for this struct was generated from the following file: