[fpc-pascal] WeekDay outdated?

Marco van de Voort marcov at stack.nl
Mon Aug 13 12:18:50 CEST 2012


In our previous episode, Jonas Maebe said:
> > I am not able to use this function:
> > http://www.freepascal.org/docs-html/rtl/dos/weekday.html
> > nor can I find it in the sources.
> > Does it still exist?
> > If yes, how to use it? Which unit? DOS does not work.
> 
> The weekday function only exists in the unix version of the Dos unit.  
> It should probably either be removed from its interface, or added to  
> the common part of the Dos unit (there's nothing unix-specific about  
> it).

As a first step I added "platform;" modifiers to all unix specific functions
in unix' unit dos.
 
> The generic function to calculate the day of the week is  
> http://www.freepascal.org/docs-html/rtl/sysutils/dayofweek.html

IIRC in Delphi dateutils.dayoftheweek is prefered since its introduction in
D6 which introduced dateutils and ISO 8601 compatible functions. (the
definition of the first day of the week differs from region to region iirc)

But the FPC docs don't mention what the first day of the week is for that
function, OR its compliance. 




More information about the fpc-pascal mailing list