Database/src/PostgreSql/Columns/Timestamp.php

22 lines
400 B
PHP

<?php
namespace Nest\Database\PostgreSql\Columns;
use Stringable;
/**
* PostgreSQL date + time column type.
*/
class Timestamp implements Stringable
{
/**
* @param bool $timezone Add timezone to the value.
*/
public function __construct(protected bool $timezone = false)
{}
public function __toString(): string
{
return "timestamp" . ($this->timezone ? " with time zone" : "");
}
}