Hi I need to get the start date and end date of current year in “01-Jan-20” format. How can i achieve this?
Let say you are getting year of today’s date in an integer variable
Create “year” as Integer
Then using an assign activity get “year” as DateTime.Now.Year
Create firstDay as DataTime variable
Then using an assign activity get “firstDay” as = New DateTime(year, 1, 1)
Create lastDay as DataTime variable
Then using an assign activity get “lastDay” as = DateTime(year, 12, 31)
-
define integer variable called currentYear, assign value to current year e.g. 2020
-
to get first date of year in dd-MMM-yy format:
New DateTime(currentYear,1,Date.DaysInMonth(currentYear,1)).ToString("dd-MMM-yy")
-
to get last date of year in dd-MMM-yy format:
New DateTime(currentYear,12,Date.DaysInMonth(currentYear,12)).ToString("dd-MMM-yy")
result of this sequence
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.