Scheduled Events

13
From the documentation online: Scheduled event time zone Added in version 4.2 The scheduled event time zone defines under which timezone scheduled events run. The default is UTC and this has been the case since 3.0. If you would like to run scheduled events under another timezone such as the timezone the office of the company is at or perhaps the project default timezone, you can select it here. This affects timezone-related operations such as parsing and formatting dates from/to strings and obtaining the beginning of the current day. If you run on-premise then you can select the timezone the server runs at, but do note that no guarantees are given for the whereabouts of application servers in the cloud. So can I set the time zone under which the scheduled event runs? Or does it refer to timezone-related operations like parsing and formatting dates? Or both? Hosted in the Mendix cloud...
asked
2 answers
7

You can set the timezone for scheduled events in the project settings, tab model.

There are 2 timezones for scheduled events, UTC or Server time. The default time zone will be used when you have datetime operations in your scheduled event.

For example in Mendix 3 if you create a microflow which logs the Timezone, the output would be:

  • Manually local : CET
  • Manually on server : CET
  • Scheduled on server : UTC

If you have a date 01-01-2013 00:00:00 CET and want to do something with that date, for example formatDateTime($Date,'dd-MMM-yyyy') the output would be

  • Manually local : 01 Jan 2013 >> (CET +0100)
  • Manually on server : 01 Jan 2013 >> (CET +0100)
  • Scheduled on server : 31 Dec 2012 >> (UTC +0000)

Since mendix 4.2 the output would be, if default timezone is CET

  • Manually local : 01 Jan 2013 >> (CET +0100)
  • Manually on server : 01 Jan 2013 >> (CET +0100)
  • Scheduled on server : 01 jan 2013 >> (CET +0100)
answered
3

There are two timezone settings that influence your scheduled event.

The first is the setting in your project settings, Stephan described this perfectly so I have nothing to add. Just select the exact time zone you want to use in your date formatting and parsing and for the details see Stephans answer.


The second configuration option is the radio button in the scheduled event itself. This influences at what time the event is started. This is either at UTC time or on the local server time.
When using UTC, the server will initiate the scheduled event when the configured time is the exact time in the UTC timezone. The scheduled event always runs at that specific time and this will never change during the year.

When using Server time, the server will initiate the scheduled event when the configured time is the exact time in the server timezone. When the application starts it checks the timezone and uses the server timezone from the server. This should also include daylight saving time in the scheduling. Which means if the selected timezone/locale supports summer time, the schedule should move one hour when daylight saving time is applied.

answered