コード例 #1
0
ファイル: Date.cpp プロジェクト: AdiKo/avmplus
    /* This needs to be publicly available, for Mac edge code. (srj) */
    double UTC(double t)
    {
#if defined(PEPPER_PLUGIN)
        // TODO(vtl): This is just a clone of the code below; we should probably provide our own
        // implementations of |VMPI_...()|.
        double adj = pepper::GetTimeZoneAdjustment();
        double dstAdjust = pepper::GetDaylightSavingTimeAdjustmentForTime(t - adj);
        if (dstAdjust != 0) {
            double dst2 = pepper::GetDaylightSavingTimeAdjustmentForTime(t - adj - kMsecPerHour);
            if (dst2 == 0)
                t += kMsecPerHour;
        }
        return (t - adj - dstAdjust);
#else
        double adj = VMPI_getLocalTimeOffset();

        // If DST is in effect, and our time value is in a "gap" period
        // (e.g. between 2:00:00AM and 2:59:59AM when DST occurs at 2:00AM)
        // we need to adjust the time +1:00 to account for the "spring forward"
        double dstAdjust = VMPI_getDaylightSavingsTA(t - adj);
        if (dstAdjust != 0)
        {
            // Date/time falls in DST, check if this is a valid time
            double dst2 = VMPI_getDaylightSavingsTA(t - adj - kMsecPerHour);
            if (dst2 == 0)
            t += kMsecPerHour;
        }

        return (t - adj - dstAdjust);
#endif
    }
コード例 #2
0
ファイル: Date.cpp プロジェクト: bsdf/trx
    /* This needs to be publicly available, for Mac edge code. (srj) */
    double UTC(double t)
    {
        double adj = VMPI_getLocalTimeOffset();

        // If DST is in effect, and our time value is in a "gap" period
        // (e.g. between 2:00:00AM and 2:59:59AM when DST occurs at 2:00AM)
        // we need to adjust the time +1:00 to account for the "spring forward"
        double dstAdjust = VMPI_getDaylightSavingsTA(t - adj);
        if (dstAdjust != 0)
        {
            // Date/time falls in DST, check if this is a valid time
            double dst2 = VMPI_getDaylightSavingsTA(t - adj - kMsecPerHour);
            if (dst2 == 0)
            t += kMsecPerHour;
        }

        return (t - adj - dstAdjust);
    }
コード例 #3
0
ファイル: Date.cpp プロジェクト: AdiKo/avmplus
    static double LocalTime(double t)
    {
#if defined(PEPPER_PLUGIN)
        // TODO(vtl): This is just a clone of the code below; we should probably provide our own
        // implementations of |VMPI_...()|.
        return t + pepper::GetTimeZoneAdjustment() +
                pepper::GetDaylightSavingTimeAdjustmentForTime(t);
#else
        return (t + VMPI_getLocalTimeOffset() + VMPI_getDaylightSavingsTA(t));
#endif
    }
コード例 #4
0
ファイル: Date.cpp プロジェクト: bsdf/trx
 static double LocalTime(double t)
 {
     return (t + VMPI_getLocalTimeOffset() + VMPI_getDaylightSavingsTA(t));
 }