Interact with date/time.
More...
#include <date_time.h>
◆ add_days()
static date liblec::lecui::date_time::add_days |
( |
date |
dt, |
|
|
int |
n |
|
) |
| |
|
static |
Add days to a given date.
- Parameters
-
dt | The date. |
n | The number of days to add. |
- Returns
- A date that is n days away from the given date.
◆ day_of_week()
static unsigned short liblec::lecui::date_time::day_of_week |
( |
date |
dt | ) |
|
|
static |
Get the day of the week for a given date.
- Parameters
-
- Returns
- The day of the week, from 1 to 7 inclusive (with Sunday as 1).
◆ from_string()
static date liblec::lecui::date_time::from_string |
( |
const std::string & |
dt | ) |
|
|
static |
Parse date from a date string.
- Parameters
-
- Returns
- The date.
◆ get_month()
static void liblec::lecui::date_time::get_month |
( |
const date |
dt, |
|
|
date & |
start, |
|
|
date & |
end |
|
) |
| |
|
static |
Get the start and end days of the month for a given date.
- Parameters
-
dt | The date. |
start | The month's start day. |
end | The month's end day. |
◆ get_week()
static void liblec::lecui::date_time::get_week |
( |
const date |
dt, |
|
|
date & |
start, |
|
|
date & |
end |
|
) |
| |
|
static |
Get the start and end days of the week for a given date.
- Parameters
-
dt | The date. |
start | The week's start day (Sunday). |
end | The week's end day (Saturday). |
◆ get_year()
static void liblec::lecui::date_time::get_year |
( |
const date |
dt, |
|
|
date & |
start, |
|
|
date & |
end |
|
) |
| |
|
static |
Get the start and end days of the year for a given date.
- Parameters
-
dt | The date. |
start | The year's start day. |
end | The year's end day. |
◆ last_day_of_month()
static date liblec::lecui::date_time::last_day_of_month |
( |
const date & |
dt | ) |
|
|
static |
Get the last day of the month for a given date.
- Parameters
-
- Returns
- The last day of the month.
◆ month_from_string()
static unsigned short liblec::lecui::date_time::month_from_string |
( |
std::string |
m | ) |
|
|
static |
Get month from string.
- Parameters
-
m | The month string, in the form "Jan". |
- Returns
- Returns the month as a number from 1 to 12 inclusive.
◆ month_to_string()
static std::string liblec::lecui::date_time::month_to_string |
( |
unsigned short |
m | ) |
|
|
static |
Get month in the form of a string.
- Parameters
-
m | The month number, from 1 to 12 inclusive. |
- Returns
- Returns the month in the form "Jan".
◆ to_string()
static std::string liblec::lecui::date_time::to_string |
( |
date |
dt | ) |
|
|
static |
Get date in the form of a string.
- Parameters
-
- Returns
- The date in the form "01-Jan-2020".
◆ today()
static date liblec::lecui::date_time::today |
( |
| ) |
|
|
static |
Get the current local date.
- Returns
- The local date.
◆ weekday_to_string()
static std::string liblec::lecui::date_time::weekday_to_string |
( |
unsigned short |
d | ) |
|
|
static |
Get week day in the form of a string.
- Parameters
-
d | The day of the week, 1 to 7 inclusive. |
- Returns
- The week day in the form "Tuesday".
The documentation for this class was generated from the following file: