Board index » delphi » How to get the number of the week.
Ronald Van Ak
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Ronald Van Ak
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
How to get the number of the week.
Hi,
I'm currently making a little source on how to create the number of Regards Ronald |
Ruud van der H
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to get the number of the week.rva...@xs4all.nl (Ronald Van Aken) wrote: Quote>Hi, routines, including conversions from an (internal) date format to the week number. My program uses the number of days since 1600-01-01 as the basis for the day number. The following code (which contains some other routines (with quite meaningful names) ) generate a week number for the specified day. Please keep in mind that the related year does not have to be the same as the year for the day number! For instance sunday 1995-01-01 is actually week 1994-52! The calcultaion given here is the standardized European week number, where the weeks start with Monday and weeks are not split into parts. The code fragment follows: Procedure _DayNrToXYearWeek(DayNr: LongInt; Var XYear: Word; Var Week: |
Alan Ho
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How to get the number of the week.rva...@xs4all.nl (Ronald Van Aken) wrote: Quote>I'm currently making a little source on how to create the number of You should be able to find the day of the year (a short routine to add in the number of days in each month) and divide by seven, then truncate. If you want the week to start on Sunday (i.e. not just have the Hope that helps. If you like, e-mail me and I'll try and send you Alan Alan Hohn -- AMH...@po.ASM-Intl.org |