Uso de zona horaria en output de comandos

This commit is contained in:
Juan Pablo Vial
2025-05-16 14:44:48 -04:00
parent 8ce7d2570d
commit 2bdb2a0ed0
4 changed files with 17 additions and 9 deletions

View File

@ -2,6 +2,7 @@
namespace Incoviba\Command\Money;
use DateTimeImmutable;
use DateTimeZone;
use Symfony\Component\Console;
use Incoviba\Common\Alias\Command;
@ -14,7 +15,7 @@ class UF extends Command
public function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int
{
$this->logger->debug("Running {$this->getName()}");
$now = new DateTimeImmutable();
$now = new DateTimeImmutable('now', new DateTimeZone($_ENV['TZ'] ?? 'America/Santiago'));
$uri = '/api/money/uf';
$data = [
'fecha' => $now->format('Y-m-d')