Date and month reverse (datetime problem)

Hello

Use the following in Assign Activity

dateTime beginDate = new DateTime(now.Year,now.Month,1)
dateTime lastDate = beginDate.AddMonths(1).AddDays(-1)

Your expected output :

string startDate = beginDate.ToString(“dd-MM-yyyy”)
string endDate = lastDate.ToString(“dd-MM-yyyy”)

Note: Use this startDate and endDate Variable in you rinput activity (TypeInto)

and my output is correct follow the date and month.

01

after i submit report,the report will downloaded. And my report name’s date should follow the date above. but my report name didnt get the date name about ,it’s month and date reverse like : 03012019-03312019. I use this “TimesheetReport1-” + beginDate.ToString(“MM-dd-yyyy”).Split(" “c)(0) + “-” + lastDate.ToString(“MM-dd-yyyy”).Split(” "c)(0) as my report name.

Can anyone pls help me to solve this problem?

You have used (“MM-dd-yyyy”) instead of (“dd-MM-yyyy”) , while giving name to ur report.
correct it.

Please mark it as solved .

@jiejie

Use following expression for report name

TimesheetReport1-” + beginDate.ToString(“dd-MM-yyyy”).Split(" “c)(0) + “-” + lastDate.ToString(“dd-MM-yyyy”).Split(” "c)(0)

Regards,
Aditya

@syedabidraza @rahatadi i want to read my excel file and i pass my date into the webpage. My date in my excel file is 01/02/2019 but when i try to pass this date to webpage ,it’s became 02/01/2019. Why?

This is my workflow to get the date from excel. Show i need to assign anything?

02

Check your system date…excel is storing date records same as system date…
Better to use csv file for data storing.

@rahatadi my system date is ddMMyyyy as show below:

if must use excel file, how to solve this problem?

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