NetSurf
|
Interface to time operations. More...
#include <time.h>
Go to the source code of this file.
Functions | |
int | nsc_sntimet (char *str, size_t size, time_t *timep) |
Write the time in seconds since epoch to a buffer. More... | |
nserror | nsc_snptimet (const char *str, size_t size, time_t *timep) |
Parse time in seconds since epoc. More... | |
nserror | nsc_strntimet (const char *str, size_t size, time_t *timep) |
Converts a date string to a number of seconds since epoch. More... | |
const char * | rfc1123_date (time_t t) |
Create an RFC 1123 compliant date string from a Unix timestamp. More... | |
Interface to time operations.
Definition in file time.h.
nserror nsc_snptimet | ( | const char * | str, |
size_t | size, | ||
time_t * | timep | ||
) |
Parse time in seconds since epoc.
This is provided as strptime is not generally portable.
str | The source buffer. |
size | The length of the source buffer. |
timep | Pointer to result. |
Definition at line 147 of file time.c.
References NSERROR_BAD_PARAMETER, NSERROR_OK, and strtoll().
Referenced by fetch_file_setup(), fetch_resource_setup(), llcache_process_metadata(), and urldb_load().
int nsc_sntimet | ( | char * | str, |
size_t | size, | ||
time_t * | timep | ||
) |
Write the time in seconds since epoch to a buffer.
This is provided as strftime is not generally portable.
str | The destination buffer. |
size | The length of the destination buffer. |
timep | The pointer to the time to write. |
Definition at line 126 of file time.c.
Referenced by llcache_serialise_metadata(), and urldb_write_timet().
nserror nsc_strntimet | ( | const char * | str, |
size_t | size, | ||
time_t * | timep | ||
) |
Converts a date string to a number of seconds since epoch.
returns the number of seconds since the Epoch, January 1st 1970 00:00:00 in the UTC time zone, for the date and time that the str parameter specifies.
datetime strings passed must be in one of the formats specified in:
[in] | str | The datetime string to parse |
[in] | size | The length of the source string |
[out] | timep | Pointer to result on success unmodified on error. |
Definition at line 980 of file time.c.
References time__get_date().
Referenced by llcache_fetch_header_cache_control(), and urldb_parse_avpair().
const char * rfc1123_date | ( | time_t | t | ) |
Create an RFC 1123 compliant date string from a Unix timestamp.
t | The timestamp to consider |
Definition at line 110 of file time.c.
References months, and weekdays_short.
Referenced by llcache_object_refetch().