Brian Dunning's FileMaker Custom Functions

CalendarDiff ( thedate ; gregorian )

Returns the number of days between a the Julian Calendar for a given date and the Gregorian Calendar

  Average rating: 4.0 (37 votes) Log in to vote

Theo Ros   Theo Ros
*
http://notapplicable.com

Share on Facebook Share on Twitter

  Sample input:
CalendarDiff ( InputDate1; True )
  Sample output:
-13
(if Inputdate contains June 20, 2005)

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Returns the number of days between a the Julian Calendar for a given date
and the Gregorian Calendar

In: thedate - a datefield in either Julian or Gregorian Calendar
gregorian - True (1) if the given date is in the Gregorian Calendar
False (0) if the given date is in the Julian Calendar

Return type: Number

To switch between calendars, use this like:
myJulianDate = myJulianDate + CalendarDiff ( GregorianDatefield ; 1 )
myGregorianDate = myGregorianDate + CalendarDiff ( JulianDateField ; 0 )

p.s. on Julian dates, do not expect Filemaker to return the DayOfWeek correctly.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: