Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2019-10

Difficulty with DayOfWeek

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ched

Dear All,

From https://www.freepascal.org/docs-html/rtl/sysutils/dayofweek.html : DayOfWeek returns the day of the week from DateTime. Sunday is counted as day 1, Saturday is counted as day 7.

From
http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/DateUtils_DayOfTheWeek.html :
DayOfTheWeek returns a value between 1 and 7, where 1 indicates Monday and 7 indicates Sunday

So, for FPC day 7 is saturday while for Delphi it's sunday... Is it a bug, a feature. Shouldn't a warning be emitted, or so ?

Cheers, Raoul

Reply by email

Luca Olivetti
to Ched

El 19/10/19 a les 12:31, Ched ha escrit:

Show quoted text 17 lines
Dear All, From https://www.freepascal.org/docs-html/rtl/sysutils/dayofweek.html : DayOfWeek returns the day of the week from DateTime. Sunday is counted as day 1, Saturday is counted as day 7. From http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/DateUtils_DayOfTheWeek.html : DayOfTheWeek returns a value between 1 and 7, where 1 indicates Monday and 7 indicates Sunday So, for FPC day 7 is saturday while for Delphi it's sunday... Is it a bug, a feature. Shouldn't a warning be emitted, or so ? Cheers, Raoul

DayOfWeek is not the same as DayOfTheWeek

http://www.delphibasics.co.uk/RTL.asp?Name=DayOfWeek

Bye

Luca

Reply by email

Winfried Bartnick
to Luca Olivetti
Luca Olivetti wrote 24 lines
El 19/10/19 a les 12:31, Ched ha escrit: > Dear All, > > >  From https://www.freepascal.org/docs-html/rtl/sysutils/dayofweek.html : > DayOfWeek returns the day of the week from DateTime. Sunday is > counted as day 1, Saturday is counted as day 7. > >  From > http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/DateUtils_DayOfTheWeek.html > : > DayOfTheWeek returns a value between 1 and 7, where 1 indicates > Monday and 7 indicates Sunday > > So, for FPC day 7 is saturday while for Delphi it's sunday... Is it a > bug, a feature. Shouldn't a warning be emitted, or so ? > > Cheers, Raoul DayOfWeek is not the same as DayOfTheWeek http://www.delphibasics.co.uk/RTL.asp?Name=DayOfWeek Bye

DayOfWeek is for USA

DayOfTheWeek is ISO Standard for the rest of the world.

Cheers Winni

Reply by email