getid3_id3v2::IsValidDateStampString

Advertisement

Syntax Syntax

getid3_id3v2::IsValidDateStampString( string $datestamp )

Parameters Parameters

$datestamp

(Required)

Return Return

(bool)

Source Source

File: wp-includes/ID3/module.tag.id3v2.php

		return true;
	}

	/**
	 * @param string $datestamp
	 *
	 * @return bool
	 */
	public static function IsValidDateStampString($datestamp) {
		if (strlen($datestamp) != 8) {
			return false;
		}
		if (!self::IsANumber($datestamp, false)) {
			return false;
		}
		$year  = substr($datestamp, 0, 4);
		$month = substr($datestamp, 4, 2);
		$day   = substr($datestamp, 6, 2);
		if (($year == 0) || ($month == 0) || ($day == 0)) {
			return false;
		}
		if ($month > 12) {
			return false;
		}
		if ($day > 31) {
			return false;
		}

Advertisement

Advertisement

Leave a Reply