Create two scheduled events (1 hour different)
In a java-action detect in daylight saving
TimeZone.getDefault().inDaylightTime( new Date() );
Decide which one of the two events/mfs you run.
I use a slightly different Java code which has the advantage of passing a date time object to it so you can also check DST in different timezones.
Regards,
Ronald
import com.mendix.systemwideinterfaces.core.UserAction;
import java.util.TimeZone;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.webui.CustomJavaAction;
/**
* Check if a time zone has DST active. Input is string with timezone like CET and a Date.
*/
public class DSTCheck extends CustomJavaAction<java.lang.Boolean>
{
private java.lang.String timeZoneString;
private java.util.Date inputDate;
public DSTCheck(IContext context, java.lang.String timeZoneString, java.util.Date inputDate)
{
super(context);
this.timeZoneString = timeZoneString;
this.inputDate = inputDate;
}
@Override
public java.lang.Boolean executeAction() throws Exception
{
// BEGIN USER CODE
TimeZone tz = TimeZone.getTimeZone(timeZoneString);
return tz.inDaylightTime(inputDate);
// END USER CODE
}
/**
* Returns a string representation of this action
*/
@Override
public java.lang.String toString()
{
return "DSTCheck";
}
// BEGIN EXTRA CODE
// END EXTRA CODE
}