1. Computing
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

IsLeapYear

unit
Sysutils
category
date/time routines

declaration
function IsLeapYear(Year: Word): boolean;

description
Returns True if a year specified is a leap year.

Use DecodeDate to obtain the value of Year for IsLeapYear from a TDateTime value.

example
var  Y, M, D: Word;

DecodeDate(Date, Y, M, D);

if IsLeapYear(Y) then
 ShowMessage('The current system year is a leap year!);

in real code

see also


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

©2013 About.com. All rights reserved.