date as flow variable for date&time widget

Hi All, I’m trying to use a flow variable with a date as default value for the date&time widget. Error: can’t parse date.

Already tried to change the format to 2024-11-01T00:00. No success.

Any Idea for solution?

@Solarianer currently there is no Flow Variable Type Date/Time. You can use strings at certain places and also convert to and from Date Variables.

1 Like

I know, that there are no date formats in the variables, but I want to set the date in the widget to a date coming from a string variable. This doesn’t work. Always the same error.


image

I tried different format, only date, date with time - alsways same failure.

Ah yes… it took me a long time to figure this one out…

You actually need to pass in a string that contains date, time and time zone!

I figured this out by creating a flow variable for the output the widget creates by filling in the text field in flow variables tab:

For test purposes I created two string variables, one with and one without timezone:

When using the one w/o timezone I get the same error as you:

image

When passing in the variable with timezone it works:

image

Here is a demo:

flowvartodtwidget.knwf (72.7 KB)

So you pretty much have to add a timezone via string manipulation to make it work!

3 Likes

OK that is an interesting insight … :slight_smile:

1 Like