Click here to Skip to main content
16,006,013 members
Home / Discussions / C#
   

C#

 
GeneralRe: Microsoft Word automation Pin
Radoslav Bielik19-Aug-03 7:16
Radoslav Bielik19-Aug-03 7:16 
GeneralAdd a progressbar to a statusbar... Pin
BoozeBomb19-Aug-03 4:18
BoozeBomb19-Aug-03 4:18 
GeneralRe: Add a progressbar to a statusbar... Pin
Heath Stewart19-Aug-03 10:04
protectorHeath Stewart19-Aug-03 10:04 
Questionany "smarter" to convert char[] to byte[]? Pin
zecodela19-Aug-03 0:32
zecodela19-Aug-03 0:32 
AnswerRe: any "smarter" to convert char[] to byte[]? Pin
Venkatraman19-Aug-03 2:24
Venkatraman19-Aug-03 2:24 
GeneralRe: any "smarter" to convert char[] to byte[]? Pin
Heath Stewart19-Aug-03 10:07
protectorHeath Stewart19-Aug-03 10:07 
GeneralDateTime manipulations Pin
kaloyan18-Aug-03 23:57
kaloyan18-Aug-03 23:57 
GeneralRe: DateTime manipulations Pin
Julian Bucknall [MSFT]19-Aug-03 7:28
Julian Bucknall [MSFT]19-Aug-03 7:28 
I take it you are using the ISO definition of a week number? (That is, a week starts on a Monday and week 1 is the week that contains the first Thursday of the year.)

To calculate the date of the Monday for a given week number, you need to calculate the date of the Monday for week 1 and then add (7 * (weeknumber-1)) days to that date.

The easiest way to do that is to calculate the date of the first Thursday and then subtract 3 days.

To calculate the date of the first Thursday, calculate the day of the week for 1-Jan for that year. If it is a: Monday, add 3 days; Tuesday, add 2; Wednesday, add 1; Thursday, you got it in one; Friday, add 6; Saturday, add 5; Sunday, add 4.

So, amalgamating all that: calc DOW for 1-Jan. For each possibility, the Monday of week 1 will therefore be

If 1-Jan is a Monday, the Monday of week 1 is 1-Jan
If 1-Jan is a Tuesday, the Monday of week 1 is 31-Dec of previous year.
If 1-Jan is a Wednesday, the Monday of week 1 is 30-Dec of previous year.
If 1-Jan is a Thursday, the Monday of week 1 is 29-Dec of previous year.
If 1-Jan is a Friday, the Monday of week 1 is 4-Jan.
If 1-Jan is a Saturday, the Monday of week 1 is 3-Jan.
If 1-Jan is a Sunday, the Monday of week 1 is 2-Jan.

So, at that point it's simple. Good luck!

Cheers, Julian
Program Manager, C#

This posting is provided "AS IS" with no warranties, and confers no rights.
GeneralRe: DateTime manipulations Pin
kaloyan20-Aug-03 19:06
kaloyan20-Aug-03 19:06 
GeneralRe: DateTime manipulations Pin
Ista19-Aug-03 16:54
Ista19-Aug-03 16:54 
GeneralRe: DateTime manipulations Pin
Julian Bucknall [MSFT]20-Aug-03 17:39
Julian Bucknall [MSFT]20-Aug-03 17:39 
GeneralWhat's different between Component and Control Pin
Libra18-Aug-03 23:25
Libra18-Aug-03 23:25 
GeneralRe: What's different between Component and Control Pin
Heath Stewart19-Aug-03 10:19
protectorHeath Stewart19-Aug-03 10:19 
Generalget contents from command line Pin
tuan_tomy18-Aug-03 22:24
tuan_tomy18-Aug-03 22:24 
GeneralRe: get contents from command line Pin
Philip Fitzsimons19-Aug-03 2:53
Philip Fitzsimons19-Aug-03 2:53 
GeneralRe: get contents from command line Pin
Ista19-Aug-03 16:57
Ista19-Aug-03 16:57 
GeneralRe: get contents from command line Pin
Philip Fitzsimons19-Aug-03 22:27
Philip Fitzsimons19-Aug-03 22:27 
Generalchart/graph in C# Pin
Member 52474018-Aug-03 22:09
Member 52474018-Aug-03 22:09 
GeneralRe: chart/graph in C# Pin
J. Dunlap18-Aug-03 22:36
J. Dunlap18-Aug-03 22:36 
GeneralRe: chart/graph in C# Pin
Member 52474018-Aug-03 22:57
Member 52474018-Aug-03 22:57 
GeneralRe: chart/graph in C# Pin
J. Dunlap18-Aug-03 23:07
J. Dunlap18-Aug-03 23:07 
GeneralRe: chart/graph in C# Pin
Member 52474018-Aug-03 23:20
Member 52474018-Aug-03 23:20 
GeneralRe: chart/graph in C# Pin
19-Aug-03 7:48
suss19-Aug-03 7:48 
GeneralRe: chart/graph in C# Pin
Member 52474019-Aug-03 8:37
Member 52474019-Aug-03 8:37 
GeneralRe: chart/graph in C# Pin
Ista19-Aug-03 16:55
Ista19-Aug-03 16:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.