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

Function _cupsStrDate

cups/string.c:145–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143 */
144
145char * /* O - Buffer */
146_cupsStrDate(char *buf, /* I - Buffer */
147 size_t bufsize, /* I - Size of buffer */
148 time_t timeval) /* I - Time value */
149{
150 struct tm date; /* Local date/time */
151 char temp[1024]; /* Temporary buffer */
152 _cups_globals_t *cg = _cupsGlobals(); /* Per-thread globals */
153
154
155 if (!cg->lang_default)
156 cg->lang_default = cupsLangDefault();
157
158 localtime_r(&timeval, &date);
159
160 if (cg->lang_default->encoding != CUPS_UTF8)
161 {
162 strftime(temp, sizeof(temp), "%c", &date);
163 cupsCharsetToUTF8((cups_utf8_t *)buf, temp, (int)bufsize, cg->lang_default->encoding);
164 }
165 else
166 strftime(buf, bufsize, "%c", &date);
167
168 return (buf);
169}
170
171
172/*

Callers 5

print_attributesFunction · 0.85
cgiSetIPPObjectVarsFunction · 0.85
show_acceptingFunction · 0.85
show_jobsFunction · 0.85
show_printersFunction · 0.85

Calls 3

_cupsGlobalsFunction · 0.85
cupsLangDefaultFunction · 0.85
cupsCharsetToUTF8Function · 0.85

Tested by 1

print_attributesFunction · 0.68