Cross-platform C SDK logo

Cross-platform C SDK

Dates

❮ Back
Next ❯
This page has been automatically translated using the Google Translate API services. We are working on improving texts. Thank you for your understanding and patience.

Date manipulation functions.


Functions

Datedate_system (void)
Datedate_add_seconds (...)
Datedate_add_minutes (...)
Datedate_add_hours (...)
Datedate_add_days (...)
int16_tdate_year (void)
intdate_cmp (...)
bool_tdate_between (...)
bool_tdate_is_null (...)
String*date_DD_MM_YYYY_HH_MM_SS (...)
String*date_YYYY_MM_DD_HH_MM_SS (...)
const char_t*date_month_en (...)
const char_t*date_month_es (...)

Types and Constants

DatekDATE_NULL

A series of functions are included within core to work with dates.


kDATE_NULL

Date kDATE_NULL;

Represents an invalid date.


date_system ()

Get the system date.

Date
date_system(void);

Return

The current date.


date_add_seconds ()

Calculate the date resulting from adding an amount of seconds to another date.

Date
date_add_seconds(const Date *date,
                 int32_t seconds);
date

The base date.

seconds

The number of seconds. If it is positive we will obtain a future date. If negative, a past date.

Return

The result date.


date_add_minutes ()

Calculate the date resulting from adding an amount of minutes to another date.

Date
date_add_minutes(const Date *date,
                 int32_t minutes);
date

The base date.

minutes

The number of minutes. If it is positive we will obtain a future date. If negative, a past date.

Return

The result date.


date_add_hours ()

Calculate the date resulting from adding an amount of hours to another date.

Date
date_add_hours(const Date *date,
               int32_t hours);
date

The base date.

hours

The number of hours. If it is positive we will obtain a future date. If negative, a past date.

Return

The result date.


date_add_days ()

Calculate the date resulting from adding an amount of days to another date.

Date
date_add_days(const Date *date,
              int32_t days);
date

The base date.

days

The number of days. If it is positive we will obtain a future date. If negative, a past date.

Return

The result date.


date_year ()

Obtiene el año actual.

int16_t
date_year(void);

Return

El año actual.


date_cmp ()

Compare two dates. The most recent date is considered greater.

int
date_cmp(const Date *date1,
         const Date *date2);
date1

First date to compare.

date2

Second date to compare.

Return

Comparison result.


date_between ()

Check if a date is within a range.

bool_t
date_between(const Date *date,
             const Date *from,
             const Date *to);
date

Date to check.

from

Start date.

to

Final date.

Return

TRUE if date is between from and to.


date_is_null ()

Checks if a date is null.

bool_t
date_is_null(const Date *date);
date

Date to check.

Return

TRUE if date is null.


date_DD_MM_YYYY_HH_MM_SS ()

Convert a date to string, with the format DD/MM/YYYY-HH:MM:SS.

String*
date_DD_MM_YYYY_HH_MM_SS(const Date *date);
date

Date.

Return

String object with conversion.


date_YYYY_MM_DD_HH_MM_SS ()

Convert a date to string, with the format YYYY/MM/DD-HH:MM:SS.

String*
date_YYYY_MM_DD_HH_MM_SS(const Date *date);
date

Date.

Return

String object with conversion.


date_month_en ()

Get the name of the month, in English.

const char_t*
date_month_en(const month_t month);
month

The month, usually obtained with btime_date.

Return

UTF8 string with the name (January, February, ...).


date_month_es ()

Get the name of the month, in Spanish.

const char_t*
date_month_es(const month_t month);
month

The month, usually obtained with btime_date.

Return

UTF8 string with the name (Enero, Febrero, ...).

❮ Back
Next ❯