[OneSignal Plugin] Wrong Date Time format

Forge Component
Published on 18 Jan by OutSystems R&D
12 votes
Published on 18 Jan by OutSystems R&D


We are currently set up this plugin on our server in USA and the API calls were failing with bad request error because send_after can't be set in past. However the time was set correctly to next day, but it seems that One Signal API can't convert date from this format “09/04/2017 18:08:26” . 

If we change send_after parameter from Date Time to Text with formatted date as "2017-09-04 17:12:26" all works perfectly.

I would suggest to have force formatting of send_after parameter before sending API request.

Thank you.

Hi Mykola,

To Solve this issue you can create your own extension which convert date time value to any date format.

Below is the extension image and code that I used to solve the same problem.

        DateTime s1 = System.Convert.ToDateTime(DateVariable);
        DateTime date = (s1);
        String frmdt = date.ToString("DateFormateVariable"); 

Hope it will work for you..