Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Explain me about Calendar Functions in PHP!

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 07-03-2010
Member
 
Join Date: Apr 2009
Posts: 452
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.!!

Reply With Quote
  #2  
Old 07-03-2010
Member
 
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.
Reply With Quote
  #3  
Old 07-03-2010
Member
 
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....
Reply With Quote
  #4  
Old 07-03-2010
Member
 
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.
Reply With Quote
  #5  
Old 07-03-2010
Member
 
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
Reply With Quote
  #6  
Old 07-03-2010
Member
 
Join Date: Oct 2005
Posts: 2,389
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
Reply With Quote
  #7  
Old 07-03-2010
Member
 
Join Date: May 2008
Posts: 2,293
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Explain me about Calendar Functions in PHP!"
Thread Thread Starter Forum Replies Last Post
My calendar and Google calendar is not synced any more in Motorola DROID XYBOARD 8.2. Daniel90 Portable Devices 4 01-04-2012 12:24 PM
How to convert date from Gregorian Calendar to Hijri Calendar in Excel AsceTic! MS Office Support 2 07-02-2012 07:50 PM
Rather than showing current date / calendar month, Microsoft calendar gadget is displaying a blank page Mustaffa Windows Software 5 23-04-2011 10:19 PM
Windows Live Mail calendar doesn't sync entries to the online calendar Koena Technology & Internet 3 18-10-2010 12:12 PM
How move XP outlook calendar data to Vista Windows Calendar Ken H Vista Help 9 25-10-2009 01:25 AM


All times are GMT +5.5. The time now is 01:11 PM.