diff --git a/LogicAppTemplate/TemplateGenerator.cs b/LogicAppTemplate/TemplateGenerator.cs index c02d230..d50d4db 100644 --- a/LogicAppTemplate/TemplateGenerator.cs +++ b/LogicAppTemplate/TemplateGenerator.cs @@ -917,10 +917,10 @@ private JToken handleActions(JObject definition, JObject parameters) if (ShouldAddTemplateParameter(recurrence["startTime"])) { string value = recurrence.Value("startTime"); - DateTime date; - if (DateTime.TryParse(value, out date)) + if (recurrence["startTime"].Type == JTokenType.Date) { - value = date.ToString("O"); + // preserve start time exactly as specified if it is a date + value = recurrence["startTime"].ToString(Formatting.None).Replace("\"", string.Empty); } definition["triggers"][trigger.Name]["recurrence"]["startTime"] = "[parameters('" + this.AddTemplateParameter(trigger.Name + "StartTime", "string", value) + "')]"; }