MCPcopy Create free account
hub / github.com/acl-dev/acl / mkdate_cst

Method mkdate_cst

lib_acl_cpp/src/mime/rfc822.cpp:316–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314#define USE_TIME_DAYLIGHT 1
315
316void rfc822::mkdate_cst(time_t t, char *buf, size_t size)
317{
318 long offset = 0;
319 struct tm tm_buf;
320 struct tm *p = acl_localtime_r(&t, &tm_buf);
321
322 buf[0] = 0;
323
324 if (p == NULL) {
325 return;
326 }
327
328#if USE_TIME_ALTZONE
329
330 offset = -_timezone;
331
332 if (p->tm_isdst > 0) {
333 offset = -altzone;
334 }
335
336 if (offset % 60) {
337 offset = 0;
338#ifdef ACL_WINDOWS
339# if _MSC_VER >= 1500
340 p = &tm_buf;
341 if (gmtime_s(p, &t) != 0) {
342 p = NULL;
343 }
344# else
345 p = gmtime(&t);
346# endif
347#else
348 p = gmtime_r(&t, &tm_buf);
349#endif
350 }
351 offset /= 60;
352#else
353#if USE_TIME_DAYLIGHT
354
355#ifdef ACL_WINDOWS
356# if _MSC_VER >= 1500
357 long s;
358 if ( _get_timezone(&s) != 0) {
359 s = 0;
360 }
361 offset =- s;
362# else
363 offset = - _timezone;
364# endif
365#elif !defined(ACL_FREEBSD) && !defined(MINGW) // XXX -zsx
366 offset = - timezone;
367#endif
368
369 if (p == NULL) {
370 return;
371 }
372
373 if (p->tm_isdst > 0) {

Callers 8

check_timeFunction · 0.80
handle_publishFunction · 0.80
build_headMethod · 0.80
qitemMethod · 0.80
show_dateMethod · 0.80
save_oneMethod · 0.80
saveMethod · 0.80
save_recordFunction · 0.80

Calls 2

acl_localtime_rFunction · 0.85
safe_snprintfFunction · 0.85

Tested by

no test coverage detected