com.caucho.quercus.lib.date
Class DateModule

java.lang.Object
  extended by com.caucho.quercus.module.AbstractQuercusModule
      extended by com.caucho.quercus.lib.date.DateModule
All Implemented Interfaces:
QuercusModule

public class DateModule
extends AbstractQuercusModule

Date functions.


Field Summary
static int CAL_GREGORIAN
           
static int CAL_JULIAN
           
 
Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
 
Constructor Summary
DateModule()
           
 
Method Summary
static int cal_days_in_month(int cal, int month, int year)
          Returns the days in a given month.
static boolean checkdate(int month, int day, int year)
          Returns the days in a given month.
static DateTime date_create(java.lang.String time, DateTimeZone dateTimeZone)
           
static void date_date_set(DateTime dateTime, int year, int month, int day)
           
static java.lang.String date_default_timezone_get(Env env)
           
static boolean date_default_timezone_set(Env env, java.lang.String id)
           
static java.lang.String date_format(DateTime dateTime, java.lang.String format)
           
static void date_isodate_set(DateTime dateTime, int year, int week, int day)
           
static void date_modify(DateTime dateTime, java.lang.String modify)
           
static long date_offset_get(DateTime dateTime)
           
static Value date_parse(java.lang.String date)
           
static ArrayValue date_sun_info(long time, double latitude, double longitude)
           
static Value date_sunrise(int timestamp, int format, double latitude, double longitude, double zenith, double gmtOffset)
           
static Value date_sunset(int timestamp, int format, double latitude, double longitude, double zenith, double gmtOffset)
           
static void date_time_set(DateTime dateTime, int hour, int minute, int second)
           
static DateTimeZone date_timezone_get(Env env, DateTime dateTime)
           
static void date_timezone_set(Env env, DateTime dateTime, DateTimeZone dateTimeZone)
           
 java.lang.String date(java.lang.String format, long time)
          Returns the formatted date.
protected static java.lang.String date(java.lang.String format, long time, QDate calendar)
           
static long easter_date(int year)
          Returns the timestamp of easter.
static long easter_days(int year, int method)
          Returns the timestamp of easter.
 Value getdate(long time)
          Returns an array of the current date.
 Value gettimeofday(Env env, boolean isFloatReturn)
           
 java.lang.String gmdate(java.lang.String format, long time)
          Returns the formatted date.
 long gmmktime(Value hourV, Value minuteV, Value secondV, Value monthV, Value dayV, Value yearV)
          Returns the formatted date.
 java.lang.String gmstrftime(java.lang.String format, long phpTime)
          Returns the formatted date.
 double gregoriantojd(int month, int day, int year)
          Convert from a gregorian date to a julian day.
 Value idate(Env env, java.lang.String format, long time)
          Returns the formatted date as an int.
 long jdtounix(double jd)
          Convert from a julian day to unix
 ArrayValue localtime(long time, boolean isAssociative)
          Returns the time as an indexed or associative array
static Value microtime(Env env, boolean getAsFloat)
          Returns the time including microseconds
 long mktime(Env env, Value hourV, Value minuteV, Value secondV, Value monthV, Value dayV, Value yearV, int isDST)
          Returns the formatted date.
 java.lang.String strftime(java.lang.String format, long phpTime)
          Returns the formatted date.
 Value strtotime(java.lang.String timeString, long now)
          Parses the time
static long time()
          Returns the current time in seconds.
static ArrayValue timezone_abbreviations_list()
           
static ArrayValue timezone_identifiers_list()
           
static Value timezone_name_from_abbr(StringValue abbr, int gmtOffset, boolean isDST)
           
static java.lang.String timezone_name_get(DateTimeZone dateTimeZone)
           
static long timezone_offset_get(DateTimeZone dateTimeZone, DateTime dateTime)
           
static DateTimeZone timezone_open(java.lang.String timeZone)
           
static Value timezone_transitions_get(DateTimeZone dateTimeZone)
           
 
Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule
getConstMap, getIniDefinitions, getLoadedExtensions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAL_GREGORIAN

public static final int CAL_GREGORIAN
See Also:
Constant Field Values

CAL_JULIAN

public static final int CAL_JULIAN
See Also:
Constant Field Values
Constructor Detail

DateModule

public DateModule()
Method Detail

cal_days_in_month

public static int cal_days_in_month(int cal,
                                    int month,
                                    int year)
Returns the days in a given month.


checkdate

public static boolean checkdate(int month,
                                int day,
                                int year)
Returns the days in a given month.


date

public java.lang.String date(java.lang.String format,
                             long time)
Returns the formatted date.


idate

public Value idate(Env env,
                   java.lang.String format,
                   long time)
Returns the formatted date as an int.


easter_date

public static long easter_date(int year)
Returns the timestamp of easter.


easter_days

public static long easter_days(int year,
                               int method)
Returns the timestamp of easter.


getdate

public Value getdate(long time)
Returns an array of the current date.


gettimeofday

public Value gettimeofday(Env env,
                          boolean isFloatReturn)

gmdate

public java.lang.String gmdate(java.lang.String format,
                               long time)
Returns the formatted date.


gmmktime

public long gmmktime(Value hourV,
                     Value minuteV,
                     Value secondV,
                     Value monthV,
                     Value dayV,
                     Value yearV)
Returns the formatted date.


gmstrftime

public java.lang.String gmstrftime(java.lang.String format,
                                   long phpTime)
Returns the formatted date.


gregoriantojd

public double gregoriantojd(int month,
                            int day,
                            int year)
Convert from a gregorian date to a julian day.


date

protected static java.lang.String date(java.lang.String format,
                                       long time,
                                       QDate calendar)

localtime

public ArrayValue localtime(long time,
                            boolean isAssociative)
Returns the time as an indexed or associative array


microtime

public static Value microtime(Env env,
                              boolean getAsFloat)
Returns the time including microseconds


mktime

public long mktime(Env env,
                   Value hourV,
                   Value minuteV,
                   Value secondV,
                   Value monthV,
                   Value dayV,
                   Value yearV,
                   int isDST)
Returns the formatted date.


strftime

public java.lang.String strftime(java.lang.String format,
                                 long phpTime)
Returns the formatted date.


strtotime

public Value strtotime(java.lang.String timeString,
                       long now)
Parses the time


time

public static long time()
Returns the current time in seconds.


jdtounix

public long jdtounix(double jd)
Convert from a julian day to unix


date_create

public static DateTime date_create(java.lang.String time,
                                   DateTimeZone dateTimeZone)

date_date_set

public static void date_date_set(DateTime dateTime,
                                 int year,
                                 int month,
                                 int day)

date_default_timezone_get

public static java.lang.String date_default_timezone_get(Env env)

date_default_timezone_set

public static boolean date_default_timezone_set(Env env,
                                                java.lang.String id)

date_format

public static java.lang.String date_format(DateTime dateTime,
                                           java.lang.String format)

date_isodate_set

public static void date_isodate_set(DateTime dateTime,
                                    int year,
                                    int week,
                                    int day)

date_modify

public static void date_modify(DateTime dateTime,
                               java.lang.String modify)

date_offset_get

public static long date_offset_get(DateTime dateTime)

date_parse

public static Value date_parse(java.lang.String date)

date_sun_info

public static ArrayValue date_sun_info(long time,
                                       double latitude,
                                       double longitude)

date_sunrise

public static Value date_sunrise(int timestamp,
                                 int format,
                                 double latitude,
                                 double longitude,
                                 double zenith,
                                 double gmtOffset)

date_sunset

public static Value date_sunset(int timestamp,
                                int format,
                                double latitude,
                                double longitude,
                                double zenith,
                                double gmtOffset)

date_time_set

public static void date_time_set(DateTime dateTime,
                                 int hour,
                                 int minute,
                                 int second)

date_timezone_get

public static DateTimeZone date_timezone_get(Env env,
                                             DateTime dateTime)

date_timezone_set

public static void date_timezone_set(Env env,
                                     DateTime dateTime,
                                     DateTimeZone dateTimeZone)

timezone_abbreviations_list

public static ArrayValue timezone_abbreviations_list()

timezone_identifiers_list

public static ArrayValue timezone_identifiers_list()

timezone_name_from_abbr

public static Value timezone_name_from_abbr(StringValue abbr,
                                            int gmtOffset,
                                            boolean isDST)

timezone_name_get

public static java.lang.String timezone_name_get(DateTimeZone dateTimeZone)

timezone_offset_get

public static long timezone_offset_get(DateTimeZone dateTimeZone,
                                       DateTime dateTime)

timezone_open

public static DateTimeZone timezone_open(java.lang.String timeZone)

timezone_transitions_get

public static Value timezone_transitions_get(DateTimeZone dateTimeZone)