Hello everybody!
I have new question.
I created a process with the following settings
so i fill Due date 2023-11-01T22:00:00
xml
<bpmn:userTask id="Activity_userTask4" name="User Task 4" camunda:formKey="anyFormKey4" camunda:assignee="Ivan" camunda:dueDate="2023-11-01T22:00:00">
<bpmn:incoming>Flow_1x9dmtj</bpmn:incoming>
<bpmn:outgoing>Flow_0jc9xyi</bpmn:outgoing>
</bpmn:userTask>
But in debug mode you can see different time (minus one hour)
my source code
List<Task> taskList = camunda.getTaskService().createTaskQuery()
.processDefinitionId(dto.getData().getProcessDefinitionId())
.initializeFormKeys()
.active().list();
so my question is why camunda-engine retrieve dueDate with minus one hour?
and how can i resolve this behavior
Thank you for any ideas
Hello my friend!
Most likely the server where your Camunda engine was deployed is in a different location than your region⦠for example⦠if you live in Brazil, but your Camunda was deployed on a US server, the time zone that the engine will consider is that of the United States.
To adjust this directly in your camunda project, you can create a camunda.cfg.xml file if you donāt already have one⦠and put the following property:
Example:
If Iām not mistaken, itās like thisā¦
<property name="defaultTimeZone">America/Sao_Paulo</property>
Remembering that you must adjust according to the time zone of the desired region, and also remembering that when doing this⦠everyone who accesses Camunda will have the same time zone that you determined in camunda.cfg.xml
.
I hope this helps!
William Robert Alves
hi my friend @WilliamR.Alves
I do all tests with that case on my local machine =)
@WilliamR.Alves help please
how can I read current default-time-zone in runtime
to check and make sure of this
And your database are in local machine too bro?
You can do something like this in your java code:
Below the same code but to copy/paste
TimeZone defaultTimeZone = TimeZone.getDefault();
System.out.println("Default timezone: " + defaultTimeZone.getDisplayName());
I hope this helps!
William Robert Alves
@WilliamR.Alves
System.out.println("Default timezone: " + defaultTimeZone.getDisplayName());
System.out.println("ZoneID: " + defaultTimeZone.toZoneId());
out
Default timezone: ŠŠ¾Ńква, ŃŃŠ°Š½Š“аŃŃŠ½Š¾Šµ Š²ŃŠµŠ¼Ń
ZoneID: Europe/Moscow
but it is not what i need.
sorry for my incorrect question. āhow can i read current default-time-zoneā
i mean ācurrent default-time-zoneā of camunda, which is set by camunda.cfg.xml
i donāt have camunda.cfg.xml, so i wanted to get default value
yes. database are in local machine too.
all environment in local machine
I donāt know if I understood your question well my friendā¦
But from what I saw, it seems to me that because Camunda is a tool created on German , it must be searching for the German time zone, which is exactly one hour different from the Moscow - Russia time zone.
What I donāt understand is why it is doing this⦠if you are running it on your local machine, I believe it was to look for the time zone of your machine⦠because as far as I know it looks for the timezone of the machine it is deployed on.
William Robert Alves
In your camunda cockpit, at the bottom you can also see the time zone that is being used.
William Robert Alves
1 Like
moshell
October 24, 2023, 4:56pm
10
WilliamR.Alves:
Hello my friend!
Most likely the server where your Camunda engine was deployed is in a different location than your region⦠for example⦠if you live in Brazil, but your Camunda was deployed on a US server, the time zone that the engine will consider is that of the United States.
To adjust this directly in your camunda project, you can create a camunda.cfg.xml file if you donāt already have one⦠and put the following property:
Example:
If Iām not mistaken, itās like thisā¦
<property name="defaultTimeZone">America/Sao_Paulo</property>
Remembering that you must adjust according to the time zone of the desired region, and also remembering that when doing this⦠everyone who accesses Camunda will have the same time zone that you determined in camunda.cfg.xml
.
I hope this helps!
i cannot find any related document described syntax how to set timezone in camunda.cfg.xml
do you have one?
moshell
October 24, 2023, 5:04pm
12
0300NBB0W3HR7T4:Documents ssnaran1$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1ed781413c00 wurstmeister/kafka "start-kafka.sh" 5 hours ago Up 5 hours 0.0.0.0:9092->9092/tcp camunda-engine-kafka
232dce557479 wurstmeister/zookeeper "/bin/sh -c '/usr/sbā¦" 5 hours ago Up 5 hours 22/tcp, 2888/tcp, 3888/tcp, 0.0.0.0:2181->2181/tcp camunda-engine-zookeeper
18eb04ed2110 postgres:11.7-alpine "docker-entrypoint.sā¦" 5 hours ago Up 5 hours 0.0.0.0:5432->5432/tcp camunda-engine-postgres
0300NBB0W3HR7T4:Documents ssnaran1$ docker exec -it 18eb04ed2110 /bin/sh
/ # date
Tue Oct 24 16:59:58 UTC 2023
/ # psql -d camunda -U camunda
psql (11.7)
Type "help" for help.
camunda=# SELECT CURRENT_TIME;
current_time
--------------------
17:00:03.178771+00
(1 row)
camunda=#
above docker container time and postgres time
both are UTC
Moscow is UTC+3
but my trouble is difference with 1 hour between process.xml and debug mode =(
@WilliamR.Alves
huuuum ⦠this seems to be something related to docker⦠try running the following command to check the time zone:
docker exec -it YOUR_DATABASE_CONTAINER_NAME psql -U DATABASE_USERNAME -d DATABASE_NAME -c āSHOW TIME ZONE;ā
(Replacing the data in bold with your real data from the application you are running.)
Take a look in this post too⦠perhaps this help you:
Iām surprised there seems to be no easy and cross-platform way to synchronize the timezone from host to container at runtime. So, the timezone in the container should not be set when itās built but when itās started. So far I found the following...
Reading time: 1 mins š
Likes: 2 ā¤
William Robert Alves
moshell
October 24, 2023, 6:11pm
14
@WilliamR.Alves i donāt think so. there is another problem
i posted above the same
0300NBB0W3HR7T4:~ ssnaran1$ docker exec -it 3e5d8d0cf9dd psql -U camunda -d camunda -c "SHOW TIME ZONE;"
TimeZone
----------
UTC
(1 row)
0300NBB0W3HR7T4:~ ssnaran1$
docker in UTC
database in UTC
even if you think the problem is in docker
look!
Moscow time is UTC+3
camunda runs in Moscow time
java runs in Moscow time
iām currently at Moscow time =)
the process xml is
<bpmn:userTask id="Activity_userTask4" name="User Task 4" camunda:formKey="anyFormKey4" camunda:assignee="Ivan" camunda:dueDate="2023-11-01T22:00:00">
<bpmn:incoming>Flow_1x9dmtj</bpmn:incoming>
<bpmn:outgoing>Flow_0jc9xyi</bpmn:outgoing>
</bpmn:userTask>
but camunda in runtime debug mode says me
List<Task> taskList = camunda.getTaskService().createTaskQuery()
.processDefinitionId(dto.getData().getProcessDefinitionId())
.initializeFormKeys()
.active().list();
so, we have difference in 1 hour, but not in 3 hour!
moshell
October 24, 2023, 6:16pm
15
āFollow up dateā param has the same behavior.
if i set it
What if you try a dueDate or followUpDate before 2023-10-29 02:00 ?
moshell
October 24, 2023, 6:42pm
18
the same. with different hours and days xD
moshell
October 24, 2023, 7:29pm
19
friend, i have another case
iāve created a simply process with service task type Expression.
but in debug mode it shows me MSK +4
is this information useful?
in other words it should be 22:13:31
so we have two cases
the first is MSK+3
the second is MSK+4
Iām completely confused
Thanks!
That shows that itās not some strange issue with some portion of the system thinking there was daylight savings ending (MSK doesnāt have DST, but other areas DO, and some of them end on the 29th at 0200)