how to geet current week

Nikki

New Member
Hi,

how to get current week in BP. want to add current week as a directory name .

Like Week1, week2
 

Ismael

New Member
You need to create a code stage. I use the following, tweaked to my needs:


C#:
Dim dfi As DateTimeFormatInfo = DateTimeFormatInfo.CurrentInfo
Dim cal As Calendar = dfi.Calendar

Result = cal.GetWeekOfYear(d, 2, 1)

¨d¨ it´s just a DateTime input parameter that you have to send to this page.

Result will be the number of the week.

In case it doesn´t fit your needs you can check microsoft documentation for GetWeekOfYear method.

I hope it helps!!
 

Sukesh Kumaru

Active Member
Make use of DateDiff function,

For Example:
DateDiff(date1, date2)
It returns the numeric value i.e Number of weeks.
Concatenate with Week.

NB: make sure the date1 is always set to the starting date of the year which you are in.
 
Top