shopifyliquidazure-logic-appsdotliquid

Getting current datetime on DotLiquid not working


I am working on a liquid template. I want to get the current DateTime so used the following

{
    "DateCreated": {{ "now" | Date: "yyyy-MM-ddTHH:mm:ss" }}
}

But resulted in the following

{
    "DateCreated": now
}

Getting the same result for "Now" also

Can anyone help me with this situation? Is there any workaround ??

Thanks


Solution

  • After a number of tries, I got a solution for this

    {
        "DateCreated": "{{ 'Now' | Date:'yyyy-MM-ddTHH:mm:ss.fffffffZ' }}",
    }
    

    This gave me the result that I expected on the logic app.