Need to set day to 1st of a month

Hello,

I need to set the date to 1st of the next month. I am able to add a month to the current date. Now I have to set the day to “1”.
For example, date is 21/09/2021 I need it to be 1/10/2021.
I am able to convert the date to 21/10/2021 by adding a month, now I need to set the day to “1”. Please help.
Thanks in advance.

grafik

first line is an example to create a new dateTime
second line demonstrates how the get dynamicly the first of month

grafik

Parsing a string with mentioned format pattern into a datetime
getting date within mentioned format as string
grafik

1 Like

Hi @arun_menon

Try to use the Expression below

date.Now.AddDays(-(date.Now.Day-1)).Date.ToString(“dd.MM.yyyy”)

Regards
Gokul

Thank you @Gokul001

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.