What Function takes in Integers and outputs a Date value?

I have a business process that needs to calculate the a date for a record's date field. Users input integers to represent Day. I need to use the current date to capture the year, and month  for example. What should the formula look like to return those three values as a date value in a parameter that I can set into a record's field?

This for reference, does not work:

DateTime([#System variable.Current Date#].Year,[#System variable.Current Date#].Month,1)

I get an error: Parameter "DateDateTimeUtilities" not found

Like 0

Like

3 comments
Best reply

So what I did was:

DateTime.Parse(([#System variable.Current Date#].Month).ToString()+"/'+[#User input day of month parameters#].ToString()+"/'+([#System variable.Current Date#].Year).ToString())

Hello.

Please use the following formula:
([#System variable.Current Time and Date#].AddDays(1 - [#System variable.Current Time and Date#].Day)).AddDays([#EnteredParameter#] - 1)

Where #EnteredParameter# is the value provided by the user.

This formula takes the current date, resets it to the first day of the current month, and then adds the number of days based on the entered parameter. As a result, it sets the desired day within the current month, while preserving the current time according to your requirements.

Best regards,
Antonii.

After fooling' around with different functions, DateTime.Parse() actually works for my use case too. withe MM/dd/YYYY format. I am able to use my parameters with the .ToString() to create the date I need.

So what I did was:

DateTime.Parse(([#System variable.Current Date#].Month).ToString()+"/'+[#User input day of month parameters#].ToString()+"/'+([#System variable.Current Date#].Year).ToString())

Show all comments