danasegarane
Active member
- Joined
- Jun 14, 2006
- Messages
- 41
- Programming Experience
- Beginner
Dear All,
How to get the Starting and Ending Date for this conditions
1.CurrentWeek(WeekstartingDate , EndingDate with respect to todaysDate)
2.MonthStart Date and End Date with Respect to Todays date
Thanks in Advance
Dana
How to get the Starting and Ending Date for this conditions
1.CurrentWeek(WeekstartingDate , EndingDate with respect to todaysDate)
2.MonthStart Date and End Date with Respect to Todays date
VB.NET:
'I have this code for WeekStart/EndDate
[COLOR=#007f00]'SerVerDate is date Got From SQlServer[/COLOR]
[COLOR=#007f00][/COLOR]
FromDate = ServerDate.AddDays(-1 * ServerDate.DayOfWeek)
ToDate = ServerDate.AddDays(7 - ServerDate.DayOfWeek - 1)
[COLOR=#007f00]'I have this code for Month Start/EndDate[/COLOR]
[COLOR=#007f00]'But it returns one day in the nextMonth also.I want Restrict to this month only[/COLOR]
[COLOR=#007f00]'How can I[/COLOR]
FromDate = [COLOR=#00007f]New[/COLOR] DateTime(ServerDate.[COLOR=#00007f]Now[/COLOR].[COLOR=#00007f]Year[/COLOR], ServerDate.[COLOR=#00007f]Now[/COLOR].[COLOR=#00007f]Month[/COLOR], 1) ToDate = [COLOR=#00007f]New[/COLOR] DateTime(ServerDate.[COLOR=#00007f]Now[/COLOR].[COLOR=#00007f]Year[/COLOR], ServerDate.AddMonths(1).[COLOR=#00007f]Month[/COLOR], 1)
Dana
Last edited: