beginOfWeekUTC($Date) - Mendix Forum

beginOfWeekUTC($Date)

2

In microflows you often have date-calculations or manipulations that are required. Currently the functions 'beginOfDay()', 'beginOfWeek()' etc. do not have a 'UTC' version. This means that if you want to get the beginOfWeek of a given date, let's say 12.10.2010, it is quite cumbersome to get your time also at 00:00:00 UTC if you're at a different timezone than UTC. The current function would result in a 'begin of your Week' UTC value of 11.10.2010 23:00:00 if you're in the UTC+1 timezone, which can be a different week. Quite inconvenient if the time-part does not matter in your application.


Oddly enough, there is already a token which somewhat provides this, being [%beginOfCurrentWeekUTC%], which is the UTC variant of the [%beginOfCurrentWeek%] token. One could mis-use these to get to the correct UTC time by adding the amount of the week-differences between the currentDateTime and 12.10.2010, but this is obviously not as easy as a function 'beginOfWeekUTC()'.


Therefore, I would like to see added date-time functions, with UTC counterparts for 'beginOfWeek' and 'endOfWeek'.

asked
0 answers