Calendar Property

Syntax

Calendar = calendarconstant calendarconstant can be either of the following constants:

Constant

Value

Description

vbCalGreg

0

Application uses the Gregorian calendar (default)

vbCalHijri

1

Application uses the Hijri calendar

Description

Returns or sets a value specifying the type of calendar to use with your project. The Gregorian calendar year of 1998 (which is based on the birth of Christ) is roughly equivalent to the Hijri year of 1418 (which is based on the birth of Mohammed). Note that the new year of each calendar is different, and the Hijri calendar, being based more accurately on the cycles of the moon, is 11 days shorter than the Gregorian calendar.

140 Chapter 7- The Language Reference

Example

Calendar = vbCalHijri

MsgBox Format(Now, "dd-mm-yyyy")

Programming Tips & Gotchas

Unless you are writing applications that will be used by or for users living or working in certain Muslim countries that use the Hijri calendar (for example, Saudi Arabia), you shouldn't need to set the Calendar property.

Was this article helpful?

0 0

Responses

  • Demet
    What is the calendar property in VBA?
    8 years ago

Post a comment