Results 1 to 7 of 7

Thread: Explain me about Calendar Functions in PHP!

  1. #1
    Join Date
    Apr 2009
    Posts
    460

    Explain me about Calendar Functions in PHP!

    Hi friends,
    I want to use the calendar in PHP. I have used the calendar in Java but I don't have much idea of using it in PHP. Actually I have recently started with the PHP programming language, so I don't have that much information about it. So please tell me about Calendar Functions in PHP.?? Any other information related to the topic would be grateful.!!

  2. #2
    Join Date
    Mar 2008
    Posts
    349

    Re: Explain me about Calendar Functions in PHP!

    The calendar extension presents a series of functions to simplify converting between different calendar formats. They are based on a Julian Day Count. The Julian Day Count is a count from 1 January 4713 BC To convert between calendar systems, you must first convert to Julian Day Count, then type in the calendar of your choice. The Julian Day Count is very different from the Julian Calendar! I would like to tell some basic things that are important to know while coding the calendar. The Gregorian calendar is a minor correction to the Julian. In the Julian calendar every fourth year is a leap year in February Which has 29, not 28 days, but in the Gregorian, years divisible by 100 are not leap years unless they are also divisible by 400.

  3. #3
    Join Date
    Jul 2006
    Posts
    286

    Re: Explain me about Calendar Functions in PHP!

    The functions that are required for the calendar are available in the standard PHP module, which is always available. You do not need any external libraries but you have to compile php with it. To run these functions with PHP, you must compile with enable-calendar. The Windows version of PHP has support for this extension. You do not add any additional library to use these functions. NetBSD Installation for PHP5 :
    • pkg_add php5-calendar

    Then to enable this module, add the following to php.ini which is usually in /usr/pkg/etc/php.ini :
    • extension=calendar.so
    IF you hate me, please don't mention it. I know who hates me and who doesn't. You really do not have to make fun of people....

  4. #4
    Join Date
    Aug 2006
    Posts
    227

    Re: Explain me about Calendar Functions in PHP!

    The predefined constants are defined by this extension, and are only available when the extension has been compiled into PHP or dynamically loaded at runtime. The following are the Predefined Constants :
    • CAL_GREGORIAN (integer)
    • CAL_JULIAN (integer)
    • CAL_JEWISH (integer)
    • CAL_FRENCH (integer)
    • CAL_NUM_CALS (integer)
    • CAL_DOW_DAYNO (integer)
    • CAL_DOW_SHORT (integer)
    I do to dead flowers what people at morgues do to dead people. Suck all the moisture out, dip them in plastic, paint them up pretty and put them in a nice frame.

  5. #5
    Join Date
    Jul 2006
    Posts
    289

    Re: Explain me about Calendar Functions in PHP!

    I am providing you with the following constants are available since PHP 4.3.0 :
    • CAL_EASTER_DEFAULT (integer)
    • CAL_EASTER_ROMAN (integer)
    • CAL_EASTER_ALWAYS_GREGORIAN (integer)
    • CAL_EASTER_ALWAYS_JULIAN (integer)

    Whereas the following constants are available since PHP 5.0.0 :
    • CAL_JEWISH_ADD_ALAFIM_GERESH (integer)
    • CAL_JEWISH_ADD_ALAFIM (integer)
    • CAL_JEWISH_ADD_GERESHAYIM (integer)
    Signatures reduce available bandwidth

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Explain me about Calendar Functions in PHP!

    The following are the Calendar Functions with their respective descriptions :
    • cal_days_in_month - Returns the number of days in a month for a year and a given schedule
    • cal_from_jd - Converts Julian Day Count to a supported calendar
    • cal_info - Returns information on a calendar
    • cal_to_jd - Converts a calendar to Julian Day Count
    • easter_date - Get Unix timestamp for midnight on Easter of a given year
    • easter_days - Returns the number of days between March 21 and Easter, for a given year
    • FrenchToJD - Converts a date from the French Republican calendar in days from the Julian calendar
    • GregorianToJD - Converts a Gregorian date in days from the Julian calendar
    • JDDayOfWeek - Returns the day of the week
    • JDMonthName - Returns the name of the month

  7. #7
    Join Date
    May 2008
    Posts
    2,297

    Re: Explain me about Calendar Functions in PHP!

    Their are many functions that you need to convert the types of the calendar. The following are some more functions that are used while doing the coding of calendar :
    • JDToFrench - Converts from Julian Day dated French Republican calendar
    • JDToGregorian - Converts from Julian Day to Gregorian date
    • jdtojewish - Converts from Julian Day in the Jewish calendar date
    • JDToJulian - Converts from Julian Day dated Julian
    • jdtounix - Converts Julian Day to UNIX timestamp
    • JewishToJD - Converts a date in the Jewish calendar in days from the Julian calendar
    • JulianToJD - Converts a Julian Day in a number of Julian Day
    • unixtojd - Convert UNIX timestamp to Julian Day

Similar Threads

  1. Replies: 4
    Last Post: 01-04-2012, 12:24 PM
  2. Replies: 2
    Last Post: 07-02-2012, 07:50 PM
  3. Replies: 5
    Last Post: 23-04-2011, 10:19 PM
  4. Replies: 3
    Last Post: 18-10-2010, 12:12 PM
  5. Replies: 9
    Last Post: 25-10-2009, 01:25 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,293,785.99984 seconds with 17 queries