> ## Documentation Index
> Fetch the complete documentation index at: https://agentictoolbox.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Time

> A tool for handling time operations and timezone conversions.

**class**: `JordanPrice\Toolbox\Tools\Time\TimeTool`\
**env vars**: `None`\
**source**: [GitHub](https://github.com/jordan-price/toolbox/blob/main/src/Tools/Time/TimeTool.php)

## Prism Integration

```php theme={null}
use JordanPrice\Toolbox\Tools\Time\TimeTool;
use EchoLabs\Prism\Prism;
use EchoLabs\Prism\Enums\Provider;
use EchoLabs\Prism\Enums\ToolChoice;

$timeTool = new TimeTool();

$prism = Prism::text()
    ->using(Provider::Anthropic, 'claude-3-5-sonnet-latest')
    ->withPrompt('What time is it in New York?')
    ->withTools([$timeTool])  // Pass the tool instance
    ->toolChoice(ToolChoice::Any);

$response = $prism->generate();
```

## Publish

Optionally, you can publish the configuration file to make modifications:

```bash theme={null}
# Publish just this tool
php artisan toolbox:publish time

# Or publish all tools
php artisan toolbox:publish --all
```

## Methods

### \_\_invoke

Get current time in specified timezone and format.

```php theme={null}
public function __invoke(string $timezone = 'UTC', string $format = 'full'): string
```

#### Parameters

* `timezone` (string): Target timezone (e.g., America/Chicago, UTC). Default is local timezone.
* `format` (string): Output format (full, short, etc.). Default is full.

#### Returns

* `string`: Formatted time in the specified timezone
