643
644
645
646
647
648
649
650
651
652
653
654
655
656
|
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
|
+
+
+
+
|
CONST time_t *t,
int useGMT)
{
struct tm *tmPtr;
time_t time;
if (!useGMT) {
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
long timezone = 0;
#endif
tzset();
/*
* If we are in the valid range, let the C run-time library handle it.
* Otherwise we need to fake it. Note that this algorithm ignores
* daylight savings time before the epoch.
*/
|
671
672
673
674
675
676
677
678
679
680
681
682
683
684
|
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
|
+
+
+
+
|
#else
#define LOCALTIME_VALIDITY_BOUNDARY 0
#endif
if (*t >= LOCALTIME_VALIDITY_BOUNDARY) {
return TclpLocaltime(t);
}
#if defined(_MSC_VER) && (_MSC_VER >= 1900)
_get_timezone(&timezone);
#endif
time = *t - timezone;
/*
* If we aren't near to overflowing the long, just add the bias and
* use the normal calculation. Otherwise we will need to adjust the
* result at the end.
|