Get a specific digit from the time integer

@param   int    The specific digit to select from the time
@return  mixed  Returns FALSE if no digit is found, otherwise
the method returns the defined digit
189975
function(i) {
			var timeStr = this.toString();
			var length  = timeStr.length;
			
			if(timeStr[length - i])	 {
				return timeStr[length - i];
			}
			
			return false;
		}
1040255
public function getSecond($timestamp = false)
    {
        if (!$timestamp) {
            $timestamp = $this->dateTime->getTimestamp();
        }

        return (int) date('s', $timestamp);
    }
750269
public function getTtl() {

        if ( is_null($this->expiration) ) return null;

        if ( $this->expiration === 0 ) return 0;

        $now = new DateTime("now");

        if ( $now > $this->expiration ) return -1;

        return (int) $now->diff($this->expiration)->format("%r%s");

    }
364543
def digit():
    ''''''
    @Parser
    def digit_parser(text, index=0):
        if index < len(text) and text[index].isdigit():
            return Value.success(index + 1, text[index])
        else:
            return Value.failure(index, 'a digit')
    return digit_parser
33192
public function get($value) {
        //TODO throw exception instead?!
        if (\is_int($value)) {
            $info = $this->getIndexAndMask($value);
            $i = $info["i"];
            $k = $info["k"];

            $flag = 1;
            $flag = $flag << $k;

            if (isset($this->array[$i])) return (($this->array[$i] & $flag) !== 0);
            return false;
        }
        return false;
    }
591965
private function getDigitPattern()
    {
        if (!isset($this->digitPattern)) {
            $lengths = array_map('strlen', $this->digits->getDigits());

            if (count(array_flip($lengths)) === 1) {
                $this->digitPattern = array_pop($lengths);
            } else {
                $this->digitPattern = sprintf(
                    '(%s|.+)s%s',
                    implode('|', array_map('preg_quote', $this->digits->getDigits())),
                    $this->digits->isCaseSensitive() ? '' : 'i'
                );
            }
        }

        return $this->digitPattern;
    }
204512
private function seconds()
    {
        // Seconds value can be an integer or float
        if ($this->lexer->isNextTokenAny(array(Lexer::T_INTEGER, Lexer::T_FLOAT))) {
            $seconds = $this->number();

            // Throw exception if seconds are greater than 60
            if ($seconds > 60) {
                throw $this->rangeError('Seconds', 60);
            }

            // Get fractional seconds
            $seconds /= 3600;

            // Match seconds symbol if requirement not colon
            if (Lexer::T_COLON !== $this->nextSymbol) {
                $this->symbol();
            }

            // Return value
            return $seconds;
        }

        // No seconds were present so return 0
        return 0;
    }
202199
protected static function digitCheck($y)
	{
		if ($y < 100){
			$yr = (integer) date("Y");
			$century = (integer) ($yr /100);

			if ($yr%100 > 50) {
				$c1 = $century + 1;
				$c0 = $century;
			} else {
				$c1 = $century;
				$c0 = $century - 1;
			}
			$c1 *= 100;
			// if 2-digit year is less than 30 years in future, set it to this century
			// otherwise if more than 30 years in future, then we set 2-digit year to the prev century.
			if (($y + $c1) < $yr+30) $y = $y + $c1;
			else $y = $y + $c0*100;
		}
		return $y;
	}
880188
public function getSeason($asInt = true)
    {
        $value = fmod($this->getRyzomSeason(), 4) + 1;

        return $asInt ? (int) $value : $value;
    }
619834
public function readDate() {
            $dateref = $this->readU29();
            if (($dateref & 0x01) == 0) {
                $dateref = $dateref >> 1;
                if ($dateref>=count($this->storedObjects)) {
                    throw new Exception('Undefined date reference: ' . $dateref);
                    return false;
                }
                return $this->storedObjects[$dateref];
            }

            $timestamp = floor($this->stream->readDouble() / 1000);

            $dateTime = new DateTime('@' . $timestamp);
            
            $this->storedObjects[] = $dateTime;
            return $dateTime;
        }
435498
public function getIsNumeric()
	{
		switch ( $this->TypeCode )
		{
			case XmlTypeCode::Decimal:
			case XmlTypeCode::Float:
			case XmlTypeCode::Double:
			case XmlTypeCode::Integer:
			case XmlTypeCode::NonPositiveInteger:
			case XmlTypeCode::NegativeInteger:
			case XmlTypeCode::Long:
			case XmlTypeCode::Int:
			case XmlTypeCode::Short:
			case XmlTypeCode::Byte:
			case XmlTypeCode::NonNegativeInteger:
			case XmlTypeCode::UnsignedLong:
			case XmlTypeCode::UnsignedInt:
			case XmlTypeCode::UnsignedShort:
			case XmlTypeCode::UnsignedByte:
			case XmlTypeCode::PositiveInteger:
				return true;
		}
		return false;
	}
204725
public function getTimestamp()
    {
        if ($this->isNull($this->value)) {
            return null;
        }
        $value = strtotime($this->getValue());

        return $value ?: null;
    }
940341
public function getAccountId()
    {
        $segments = $this->getSegments();

        if (reset($segments) === 'account' && isset($segments[1]) && ctype_digit($segments[1])) {
            return (int) $segments[1];
        }

        return false;
    }
652370
public function getInt($key)
    {
        try {
            $result = $this->get(self::INT, $key);
            if (!settype($result, 'integer')) {
                return 0;
            }
        } catch (\Exception $e) {
            return 0;
        }
        return $result;
    }
204596
public static function timeToInt($time)
    {
        $timeHour = substr($time, 0, 2);
        if (substr($time, 0, 1) == '0') {
            $timeHour = substr($time, 1, 1);
        }
        $timeMin     = substr($time, 3, 5);
        $timeHourMin = ((int)$timeHour * 60) + ((int)$timeMin / 1);
        $values      = $timeHourMin;

        return $values;
    }
975392
public function getAge()
    {
        $result = false;
        if (isset($this->_claims['iat']) && is_numeric($this->_claims['iat'])) {
            $result = max(time() - $this->_claims['iat'], 0);
        }

        return $result;
    }
64361
public function getUpdatedAtTimestamp(): ?int
    {
        if (!$this->hasUpdatedAt()) {
            return null;
        }

        $timestamp = strtotime($this->getUpdatedAt() . 'UTC');

        if ($timestamp === false) {
        	throw new Exception("Unable to get timestamp from \"{$this->getUpdatedAt()}\"");
        }

        return $timestamp;
    }