Written by Cesar
2002.7.23 (correction)
Regarding the algorithm, there is no serious consideration. It is ok. I don't know if it is correct. I hope everyone will correct. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ----------------------------------------- Returns a string value.
Public string weekofyear () {// first take the year's year String Year = Convert.toString (DateTime.today.year); // Conversion this year's first day DateTime firstofyear = datetime.parse ("01 01" year); // The first day of the year is the day INT firstofweek = Convert.Toint32 (firsttofyear.dayofweek); // Today is this year's days the first day of the year is the day of the week, then except 7. Return Convert.toString ((DateTime) . Today.dayofyear firstofweek 6) / 7);