src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/utils.php
public static function getDayTimestamp($now = null, $offset = 8) {
        $now = $now === null ? time() : $now;
        
        $gtm0 = $now - ($now % 86400); // GTM 0
        
        $dayline = ($now - $gtm0) / 3600;
        
        // 时差跨天
        if ($dayline + $offset > 23) {
            return $gtm0 + 86400 + $offset * 3600 * - 1;
        } else {
            return $gtm0 + $offset * 3600 * - 1;
        }
    }
public static function getDayTimestamp($now = null, $offset = 8) {
        $now = $now === null ? time() : $now;
        
        $gtm0 = $now - ($now % 86400); // GTM 0
        
        $dayline = ($now - $gtm0) / 3600;
        
        // 时差跨天
        if ($dayline + $offset > 23) {
            return $gtm0 + 86400 + $offset * 3600 * - 1;
        } else {
            return $gtm0 + $offset * 3600 * - 1;
        }
    }
public static function getDayTimestamp ( $ now = null , $ offset = 8 ) { $ now = $ now === null ? time ( ) : $ now ; $ gtm0 = $ now - ( $ now % 86400 ) ; // GTM 0 $ dayline = ( $ now - $ gtm0 ) / 3600 ; // 时差跨天 if ( $ dayline + $ offset > 23 ) { return $ gtm0 + 86400 + $ offset * 3600 * - 1 ; } else { return $ gtm0 + $ offset * 3600 * - 1 ; } }
get the timestamp at current dat start

NOTE: the result start at the timezone (GTM +8) 00:00:00, not the GTM 0.

@param
{number} offset, offset of timezone;
@return number
get the timestamp at current dat start