MCPcopy Create free account
hub / github.com/OpenPrinting/cups / ippTimeToDate

Function ippTimeToDate

cups/ipp.c:3929–3970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3927 */
3928
3929const ipp_uchar_t * /* O - RFC-2579 date/time data */
3930ippTimeToDate(time_t t) /* I - Time in seconds */
3931{
3932 struct tm unixdate; /* UNIX unixdate/time info */
3933 ipp_uchar_t *date = _cupsGlobals()->ipp_date;
3934 /* RFC-2579 date/time data */
3935
3936
3937 /*
3938 * RFC-2579 date/time format is:
3939 *
3940 * Byte(s) Description
3941 * ------- -----------
3942 * 0-1 Year (0 to 65535)
3943 * 2 Month (1 to 12)
3944 * 3 Day (1 to 31)
3945 * 4 Hours (0 to 23)
3946 * 5 Minutes (0 to 59)
3947 * 6 Seconds (0 to 60, 60 = "leap second")
3948 * 7 Deciseconds (0 to 9)
3949 * 8 +/- UTC
3950 * 9 UTC hours (0 to 11)
3951 * 10 UTC minutes (0 to 59)
3952 */
3953
3954 gmtime_r(&t, &unixdate);
3955 unixdate.tm_year += 1900;
3956
3957 date[0] = (ipp_uchar_t)(unixdate.tm_year >> 8);
3958 date[1] = (ipp_uchar_t)(unixdate.tm_year);
3959 date[2] = (ipp_uchar_t)(unixdate.tm_mon + 1);
3960 date[3] = (ipp_uchar_t)unixdate.tm_mday;
3961 date[4] = (ipp_uchar_t)unixdate.tm_hour;
3962 date[5] = (ipp_uchar_t)unixdate.tm_min;
3963 date[6] = (ipp_uchar_t)unixdate.tm_sec;
3964 date[7] = 0;
3965 date[8] = '+';
3966 date[9] = 0;
3967 date[10] = 0;
3968
3969 return (date);
3970}
3971
3972
3973/*

Callers 11

mainFunction · 0.85
token_cbFunction · 0.85
copy_job_attributesFunction · 0.85
create_jobFunction · 0.85
add_jobFunction · 0.85
copy_job_attrsFunction · 0.85
copy_printer_attrsFunction · 0.85
set_timeFunction · 0.85
mainFunction · 0.85
parse_valueFunction · 0.85

Calls 1

_cupsGlobalsFunction · 0.85

Tested by

no test coverage detected