<?php

namespace JWX\JWT\Claim\Feature;


/**
 * Trait for claims having NumericDate value.
 */
trait NumericDateClaim
{
	/**
	 * Initialize instance from date/time string
	 *
	 * @param string $time <code>strtotime</code> compatible time string
	 * @param string $tz Default timezone
	 * @return static
	 */
	public static function fromString($time, $tz = "UTC") {
		$dt = new \DateTimeImmutable($time, new \DateTimeZone($tz));
		return new static($dt->getTimestamp());
	}
	
	/**
	 * Get date as a unix timestamp
	 *
	 * @return int
	 */
	public function timestamp() {
		return (int) $this->_value;
	}
	
	/**
	 * Get date as a datetime object
	 *
	 * @return \DateTimeImmutable
	 */
	public function dateTime() {
		return \DateTimeImmutable::createFromFormat("!U", $this->_value, 
			new \DateTimeZone("UTC"));
	}
}

<?php

namespace JWX\JWT\Claim\Feature;


/**
 * Trait for claims having NumericDate value.
 */
trait NumericDateClaim
{
	/**
	 * Initialize instance from date/time string
	 *
	 * @param string $time
	 * @return static
	 */
	public static function fromString($time) {
		$dt = new \DateTimeImmutable($time, new \DateTimeZone("UTC"));
		return new static($dt->getTimestamp());
	}
	
	/**
	 * Get date as a unix timestamp
	 *
	 * @return int
	 */
	public function timestamp() {
		return (int)$this->_value;
	}
	
	/**
	 * Get date as a datetime object
	 *
	 * @return \DateTimeImmutable
	 */
	public function dateTime() {
		return \DateTimeImmutable::createFromFormat("!U", $this->_value, 
			new \DateTimeZone("UTC"));
	}
}

--- 
+++ 
@@ -11,11 +11,12 @@
 	/**
 	 * Initialize instance from date/time string
 	 *
-	 * @param string $time
+	 * @param string $time <code>strtotime</code> compatible time string
+	 * @param string $tz Default timezone
 	 * @return static
 	 */
-	public static function fromString($time) {
-		$dt = new \DateTimeImmutable($time, new \DateTimeZone("UTC"));
+	public static function fromString($time, $tz = "UTC") {
+		$dt = new \DateTimeImmutable($time, new \DateTimeZone($tz));
 		return new static($dt->getTimestamp());
 	}
 	
@@ -25,7 +26,7 @@
 	 * @return int
 	 */
 	public function timestamp() {
-		return (int)$this->_value;
+		return (int) $this->_value;
 	}
 	
 	/**
Add timezone parameter to fromString