Hi
I have a date in UK Format (dd/mm/yyyy). I want to get a series of days
after that date, but NOT Saturday or Sunday
For example, if the date is 13/12/2004 (next Monday) and I get the next 9
dates, I want to end up with a full list like.. 13, 14, 15, 16, 17, 20, 21,
22, 23, 24 (2wks, mon-fri).
How can I acheive this? (im using C#)
Cheers
Dan 4 4777
Make a DateTime variable, increment it in a loop and check DayOfWeek
property.
Eliyahu
"dhnriverside" <da*@musoswire.com> wrote in message
news:46**********************************@microsof t.com... Hi
I have a date in UK Format (dd/mm/yyyy). I want to get a series of days after that date, but NOT Saturday or Sunday
For example, if the date is 13/12/2004 (next Monday) and I get the next 9 dates, I want to end up with a full list like.. 13, 14, 15, 16, 17, 20,
21, 22, 23, 24 (2wks, mon-fri).
How can I acheive this? (im using C#)
Cheers
Dan
"dhnriverside" <da*@musoswire.com> wrote in message
news:46**********************************@microsof t.com... Hi
I have a date in UK Format (dd/mm/yyyy). I want to get a series of days after that date, but NOT Saturday or Sunday
For example, if the date is 13/12/2004 (next Monday) and I get the next 9 dates, I want to end up with a full list like.. 13, 14, 15, 16, 17, 20, 21, 22, 23, 24 (2wks, mon-fri).
How can I acheive this? (im using C#)
Did you look at the members of the DateTime structure?
John Saunders
Hi
Have checked out DateTime, and come up with the following code. It's
supposed to increment the dates by a week, and create a string of the dates...
DateTime dates;
dates = DateTime.Parse(txtSessionDate.Text); // txtSessionDate.Text =
15/12/2004
listOfDates = dates.ToShortDateString();
//weeks
for(x=0; x < Convert.ToInt32(txtRecurs.Text); x++)
{
xw = x * 7;
DateTime newdate;
newdate = dates;
newdate.AddDays(xw);
listOfDates += ", " + newdate.ToShortDateString();
}
It creates a string of dates, but the AddDays method doesn't seem to be
doing anything. It compiles, but all the dates in the string are the same?!
Cheers
Dan
"John Saunders" wrote: "dhnriverside" <da*@musoswire.com> wrote in message news:46**********************************@microsof t.com... Hi
I have a date in UK Format (dd/mm/yyyy). I want to get a series of days after that date, but NOT Saturday or Sunday
For example, if the date is 13/12/2004 (next Monday) and I get the next 9 dates, I want to end up with a full list like.. 13, 14, 15, 16, 17, 20, 21, 22, 23, 24 (2wks, mon-fri).
How can I acheive this? (im using C#)
Did you look at the members of the DateTime structure?
John Saunders
"dhnriverside" <da*@musoswire.com> wrote in message
news:3B**********************************@microsof t.com... Hi
Have checked out DateTime, and come up with the following code. It's supposed to increment the dates by a week, and create a string of the dates...
DateTime dates; dates = DateTime.Parse(txtSessionDate.Text); // txtSessionDate.Text = 15/12/2004 listOfDates = dates.ToShortDateString(); //weeks for(x=0; x < Convert.ToInt32(txtRecurs.Text); x++) { xw = x * 7; DateTime newdate; newdate = dates; newdate.AddDays(xw); listOfDates += ", " + newdate.ToShortDateString(); }
It creates a string of dates, but the AddDays method doesn't seem to be doing anything. It compiles, but all the dates in the string are the same?!
AddDays is a function:
newdate = dates.AddDays(xw);
John Saunders This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Anthony Robinson |
last post by:
Is anyone aware of a function (system or user defined) that will
calculate business days? For instance: I have a column in as table
called DATE. I want to be able to add five business days to that...
|
by: BlackFireNova |
last post by:
I need to write a report in which one part shows a count of how many
total records fall within the working days (Monday - Friday) inside of a
(prompted) given date range, in a particular...
|
by: dixie |
last post by:
I have a report which is printed daily. It is a list of people. A person
can be put on this list for one day, which is easyily achieved from a simple
form. My problem is that a person can also...
|
by: kumarkanth |
last post by:
My question is how do I manipulate the procedure to calculate cut-off date with in working days and it should skip weekends and holidays?
I have holiday table to determine holidays
Table Name :...
|
by: =?Utf-8?B?UGF1bA==?= |
last post by:
Hi, I have a web application that I need to add 3 days to the Now day, but
need to make sure that I skip weekends and holidays. For example if Now is
friday, 3 days + now should be tuesday,...
| |
by: Mike |
last post by:
I have a routine that's calculating business days but its not counting the
weekend days that are between the start date and end date. If my start date
is 9/26/08 and my end date is 10/01/08, I...
|
by: FishVal |
last post by:
IMHO, the following is not a how-to-do instruction to solve a particular problem but more a concept-proof stuff demonstrating possibilities of SQL.
So, let us say the problem is to calculate...
|
by: geraldjr30 |
last post by:
hi,
i have the following to calculate working days between 2 dates, but i am not getting the right amount. i should be getting 11 instead of 12, because feb 16 2009 was a holiday. can someone...
|
by: geraldjr30 |
last post by:
hi,
i have the following:
<?php
echo"test";
//The function returns the no. of business days between two dates and it skips the holidays
function...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| | |