DateTime.DateFormat = "dd/MM/yyyy"
Dim seldate As Long = DateTime.DateParse("02/05/2014")
Dim n As Int = DateTime.GetDayOfWeek(seldate)
Dim Mt As Long = seldate - (n-2)* DateTime.TicksPerDay
Dim Ft As Long = seldate - (n-6)* DateTime.TicksPerDay
Log("Monday = " & DateTime.Date(Mt) & " Friday = " & DateTime.Date(Ft))
DateTime.DateFormat = "dd/MM/yyyy"
Dim seldate As Long = DateTime.DateParse("02/05/2014")
Dim n As Int = DateTime.GetDayOfWeek(seldate)
Dim p1 As Period
p1.Days = 2 - n
Dim Mt As Long = DateUtils.AddPeriod(seldate, p1)
p1.Days = 6 - n
Dim Ft As Long = DateUtils.AddPeriod(seldate, p1)
Log("Monday = " & DateTime.Date(Mt) & " Friday = " & DateTime.Date(Ft))
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.