-
Notifications
You must be signed in to change notification settings - Fork 11
Labels
Description
No duplicates π₯².
- I have searched for a similar issue in our bug tracker and didn't find any solutions.
What happened?
Workflow::now method returns time in UTC timezone, although timezone is specified as Europe/Moscow.
Output php-container:
root@7196f7dc3930:/app# php -r 'var_dump(date_default_timezone_get());'
Command line code:1:
string(13) "Europe/Moscow"Output Temporal server:
/etc/temporal $ printenv
HOSTNAME=51cb1279e344
DB_PORT=5432
SHLVL=1
HOME=/home/temporal
ES_SEEDS=cash_vanta_temporal_elasticsearch
TEMPORAL_HOME=/etc/temporal
TEMPORAL_SHA=fb617040c84afe4c787645a33816fda2b6fe775b
DB=postgres12
TERM=xterm
POSTGRES_PWD=temporal
ENABLE_ES=true
TCTL_SHA=57f54ad72a8170e7e65b04df62c8a906f77df698
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
POSTGRES_USER=temporal
ES_VERSION=v7
DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/dev.yaml
TEMPORAL_CLI_ADDRESS=cash_vanta_temporal_server:7233
PWD=/etc/temporal
TEMPORAL_ADDRESS=cash_vanta_temporal_server:7233
TZ=Europe/Moscow
POSTGRES_SEEDS=cash_vanta_temporal_postgresql
/etc/temporal $ date
Fri Jan 24 20:19:02 MSK 2025Code repoduce:
<?php
declare(strict_types=1);
namespace App\LoanApplication\Workflow;
use Temporal\Workflow;
use Temporal\Workflow\WorkflowInterface;
use Temporal\Workflow\WorkflowMethod;
#[WorkflowInterface]
final class TestWorkflow
{
#[WorkflowMethod()]
public function run(): \Generator
{
while (true) {
yield Workflow::timer('3 seconds');
$currentDate = yield Workflow::sideEffect(static fn(): \DateTimeImmutable => new \DateTimeImmutable());
dump($currentDate, $currentDate->getTimeZone());
dump(Workflow::now(), Workflow::now()->getTimezone());
}
}
}Event history
Version
Temporal server: 1.22.4
RoadRunner: 2024.2.1
php-sdk: 2.11.2
