2023年10月27日 星期五

delphi now today weekday isoday = (dayofweek + 5) mod 7 + 1

https://docwiki.embarcadero.com/CodeExamples/Sydney/en/DayOfWeek_(Delphi)
https://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.DayOfWeek
http://www.delphibasics.co.uk/RTL.php?Name=DayOfTheWeek
https://en.wikipedia.org/wiki/Leap_year
https://en.wikipedia.org/wiki/Leap_week_calendar
https://github.com/akshayvadher/leap-years-tdd
https://github.com/stdlib-js/assert-is-leap-year
https://github.com/search?q=leap+language%3APascal+&type=repositories
https://github.com/search?q=leap+calendar+language%3APascal+&type=code
delphi today weekday leap calendar
https://www.delphibasics.co.uk/Method.php?NameSpace=System.Globalization&Class=Calendar&Type=Class&Method=GetDayOfWeek
today weekday leap calendar GetDayOfWeek libraries easiest method  calculating
Algorithms for Calculating Day of Week
https://calendars.fandom.com/wiki/Calculating_the_day_of_the_week
https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week
https://learn.microsoft.com/zh-tw/dotnet/api/system.globalization.calendarweekrule?view=net-7.0
https://stackoverflow.com/questions/71269276/same-dayofweek-for-a-given-year-in-delphi
 isoday = (dayofweek + 5) mod 7 + 1

delphi today weekday leap calendar  System Globalization  today weekday leap calendar GetDayOfWeek libraries easiest method  calculating Algorithms for Calculating Day of Week calendars Calculating

http://www.delphigroups.info/2/5b/83334.html
Warning : ISO-8601 calls for Monday=1, Sunday=7. ISOday = (DayOfWeek+6) mod 7. -- ? John Stockton, Surrey, UK. j.

can also be usefull:

var
  FirstWeekDay: Integer = 2; { first day of week
    2 : monday (DIN 1355) }
  FirstWeekDate: Integer = 4; { date in first week
    1 : year starts on Jan 1st
    4 : first "4-day-week" (DIN 1355)
    7 : first complete week }

{ Returns date of first day of week }
function WeekToDate(AWeek, AYear: Integer): TDateTime;
begin
  Result := EncodeDate(AYear, 1, FirstWeekDate);
  Result := Result + (AWeek - 1) * 7 - ((DayOfWeek(Result) + (7 -
FirstWeekDay)) mod 7);
end;

{ Returns no. of week and year the week belongs to }
procedure DateToWeek(ADate: TDateTime; var AWeek, AYear: Integer);
var
  Month, Day: Word;
begin
  ADate := ADate - ((DayOfWeek(ADate) - FirstWeekDay + 7) mod 7) + 7 -
FirstWeekDate;
  DecodeDate(ADate, AYear, Month, Day);
  AWeek := (Trunc(ADate - EncodeDate(AYear, 1, 1)) div 7) + 1;
end; 


TASClient/ESBDates.pas at master · spring-archive ...https://github.com › spring-archive › TASClient › blob  Lobby Client for Windows written in Delphi. Contribute to spring-archive/TASClient development by creating an account on GitHub.

JclDateTime.pas  https://github.com › source › common The result is an integer between // 1 and 7, corresponding to Sunday through Saturday. ISODayOfWeek on the other hand returns an integer // between 1 and 7 ...

dayofweek · GitHub Topics https://github.com › topics › dayofweek Python function accepts mm/dd/yyyy and outputs day of week as string and integer. Any date since 1600. python calendar dates gregorian-calendar gregorian-date ...
 
GpDelphiUnits/src/GpTimezone.pas at master  https://github.com › gabr42 › blob › Gp... weekday (0 to 6, 0 = Sunday), and using a wDay value in the range 1 through 5 to select the correct day in the month. Year parameter is used to specify year ...

Calculate the local day of the week from Unix time and time ...https://gist.github.com › ...Calculate the local day of the week from Unix time and time zone offset - dayofweek.c.
 
SQL Server: DateTime.DayOfWeek translation · Issue #10404  https://github.com › aspnet › issues  Currently there is no translation for DayOfWeek property of DateTime value, it evaluates on client. When using in complex queries it can ...
 
filter on day of week · Issue #624  https://github.com › npgsql › issue try to filter a datetime field on the day of the week. For example (if I only want mondays): DayOfWeek d = DayOfWeek.Monday; filter.
 
ISOWeek.cs  https://github.com › src › Globalization... DayOfWeek) + 10) / 7; } // Day of week in ISO is represented by an integer from 1 through 7, beginning with Monday and ending with Sunday. // This matches ...

GpDelphiUnits/src/GpStuff.pas at master - gabr42 https://github.com › gabr42 › GpDelphiUnits › blob › G...A collection of my open sourced Delphi units. Contribute to gabr42/GpDelphiUnits development by creating an account on GitHub.
https://github.com/gabr42/GpDelphiUnits/tree/master

Calendar Globalization DayOfWeek https://learn.microsoft.com/zh-tw/dotnet/api/system.globalization.calendar.getdayofweek?view=net-7.0

WeekDay Get Current Week (VB.NET)  Private Function GetCurrentWeek() As String  Dim dat As DateTime = DateTime.Now() Dim culInfo As New CultureInfo(“zh-TW") Dim cal As Calendar = culInfo.Calendar() Dim week As Integer = cal.GetWeekOfYear(dat, CalendarWeekRule.FirstDay, DayOfWeek.Sunday) Return week.ToString(“00″)


algorithms date time
https://www.researchgate.net/publication/316558298_Date_Algorithms
Gregorian Calendar Julian date  Julian Day
https://liuzhenglaichn.gitbook.io/algorithm/date
https://en.wikibooks.org/wiki/Algorithm_Implementation/Date_and_time/Conversion_of_a_Gregorian_date_to_an_International_Fixed_Calendar_date
https://copyprogramming.com/t/algorithm-to-determine-if-a-given-datetime#google_vignette
https://www.boost.org/doc/libs/1_54_0/doc/html/date_time/gregorian.html
https://learn.microsoft.com/en-us/analysis-services/data-mining/microsoft-time-series-algorithm?view=asallproducts-allversions

NOAA’s National Geodetic Survey (NGS) provides the framework Existing algorithms and source code available
https://geodesy.noaa.gov/gps-toolbox/exist.htm

沒有留言: