25#ifndef MUTT_MUTT_DATE_H
26#define MUTT_MUTT_DATE_H
40#define TIME_T_MAX ((((time_t) 1 << (sizeof(time_t) * 8 - 2)) - 1) * 2 + 1)
41#define TIME_T_MIN (-TIME_T_MAX - 1)
43 (1970 + (((((TIME_T_MAX - 59) / 60) - 59) / 60) - 23) / 24 / 366)
44#define TM_YEAR_MIN (1970 - (TM_YEAR_MAX - 1970) - 1)
struct tm mutt_date_localtime(time_t t)
Converts calendar time to a broken-down time structure expressed in user timezone.
size_t mutt_date_localtime_format(char *buf, size_t buflen, const char *format, time_t t)
Format localtime.
uint64_t mutt_date_now_ms(void)
Return the number of milliseconds since the Unix epoch.
void mutt_date_make_date(struct Buffer *buf, bool local)
Write a date in RFC822 format to a buffer.
time_t mutt_date_make_time(struct tm *t, bool local)
Convert struct tm to time_t
void mutt_date_sleep_ms(size_t ms)
Sleep for milliseconds.
int mutt_date_check_month(const char *s)
Is the string a valid month name.
struct tm mutt_date_gmtime(time_t t)
Converts calendar time to a broken-down time structure expressed in UTC timezone.
size_t mutt_date_localtime_format_locale(char *buf, size_t buflen, const char *format, time_t t, locale_t loc)
Format localtime using a given locale.
int mutt_date_make_tls(char *buf, size_t buflen, time_t timestamp)
Format date in TLS certificate verification style.
int mutt_date_make_imap(struct Buffer *buf, time_t timestamp)
Format date in IMAP style: DD-MMM-YYYY HH:MM:SS +ZZzz.
int mutt_date_local_tz(time_t t)
Calculate the local timezone in seconds east of UTC.
time_t mutt_date_add_timeout(time_t now, time_t timeout)
Safely add a timeout to a given time_t value.
time_t mutt_date_now(void)
Return the number of seconds since the Unix epoch.
time_t mutt_date_parse_date(const char *s, struct Tz *tz_out)
Parse a date string in RFC822 format.
time_t mutt_date_parse_imap(const char *s)
Parse date of the form: DD-MMM-YYYY HH:MM:SS +ZZzz.
void mutt_time_now(struct timespec *tp)
Set the provided time field to the current time.
void mutt_date_normalize_time(struct tm *tm)
Fix the contents of a struct tm.
static const char * timestamp(time_t stamp)
Create a YYYY-MM-DD HH:MM:SS timestamp.
String manipulation buffer.
List of recognised Timezones.
unsigned char zminutes
Minutes away from UTC.
bool zoccident
True if west of UTC, False if East.
char tzname[8]
Name, e.g. UTC.
unsigned char zhours
Hours away from UTC.