<?php

namespace Blazemedia\Blackhole\Tools;

class TimeHelper {

    const ONE_MONTH = 3600 * 24 * 30;
    const MONTHS    = 6;


    static function isOlderThen( int|string $date_a, int|string $date_b,  ) : bool {

        return self::getTimeStamp( $date_a ) >  self::getTimeStamp( $date_b ) ;
    }


    static function getAgeInSeconds( string|int $date ) : int {

        return  strtotime( 'now' ) - self::getTimeStamp( $date );

    }

    static function getTimeStamp( int|string $date ) {

        return is_string( $date ) ? strtotime( $date ) : $date;
    }

}
