Search code examples
timepascallazarus

Get current month as number in Pascal


I've got an assignment to do which involves seeing if there are any birthdays this month. I'm not asking for you to 'do my homework', but what I am asking is this: is there a way to get the current month as a number from 1-12 in Pascal (specifically, Lazarus Pascal)? Then I can take the number and compare it with records held in file.

Thanks for any help,

James


Solution

  • I don't know about Lazarus, but most Pascal implementations provide:

    procedure GetDate(var Year, Month, Day, DayofWeek: Word);