How to add constant value between month and year

Hi all,

I have to check current data(20/09/2015) is > 15 of every month or not(09/15/2019)
using Datetime.now.tostring(“MM/yyyy”) - i will get output as 09-2019

but i need expected output like 09-15-2019 (add constant value(15 between month and year )

Hi,

Not sure if i understood correctly but if you just want to have current month, year with date as 15:
myDate = new DateTime(Now.Year, Now.Month, 15)

br,
Topi

1 Like

DateTime.Now.ToString(“MM”)+"/15/"+DateTime.Now.Year.ToString

this is the correct syntax to use dynamic month and year but date was constant (09/15/2019)

@Naveen.Ch Follow below solution

   Assign str = "09-2019"
   Assign str = str.Insert.(3,"15-")

  Now str will have   **09-15-2019**
1 Like
  1. If Activity – NOT (now.Month>val(15))
    Then
    Assign: reqdate = new DateTime(Now.Year, Now.Month, 15)
    Write Line: reqdate.ToShortDateString
    test.xaml (6.0 KB)
    Thanks!
1 Like

Hi @Naveen.Ch,

I’m attaching a .zip file where you can find the workflow, you may expect. Hope it will help you.
Test.zip (201.8 KB)

Thanks & regards,
Apurba

2 Likes

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