# isValidNow

Learn how to check whether the token is currently valid.

This method reports whether the token is within its validity period. The token is valid when the current time is at or after the issue time and before the expiration time.

## Signature

This method has the following signature:

```php
public function isValidNow(?int $now = null): bool
```

This method returns `true` when the token is currently within its validity period, and `false` otherwise.

## Example

Here is a basic example of how to use this method:

```php
<?php
use Croct\Plug\Croct;

$croct = Croct::fromDotenv();
$token = $croct->getUserToken();

if ($token->isValidNow()) {
    // The token is within its validity period.
}
```

## Parameters

The following list describes the supported parameters:

- `now`: `int|null` (optional) (default: null)

  The reference time to check against, as a Unix timestamp in seconds. The default is `null`, which uses the current time.
