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(Env env, int cal, int month, int year)
          Returns the days in a given month.
static boolean checkdate(Env env, int month, int day, int year)
          Returns the days in a given month.
static DateTime date_create(Env env, 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(Env env, 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(Env env, java.lang.String format, long time)
          Returns the formatted date.
protected static java.lang.String dateImpl(java.lang.String format, long time, QDate calendar)
          Returns the formatted date.
static long easter_date(Env env, int year)
          Returns the timestamp of easter.
static long easter_days(Env env, int year, int method)
          Returns the timestamp of easter.
 java.util.Map<StringValue,Value> getConstMap()
           
 Value getdate(Env env, Value timeV)
          Returns an array of the current date.
 java.lang.String[] getLoadedExtensions()
          Returns true for the date extension.
 Value gettimeofday(Env env, boolean isFloatReturn)
           
 java.lang.String gmdate(Env env, java.lang.String format, long time)
          Returns the formatted date.
 long gmmktime(Env env, Value hourV, Value minuteV, Value secondV, Value monthV, Value dayV, Value yearV)
          Returns the formatted date.
 java.lang.String gmstrftime(Env env, 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(Env env, double jd)
          Convert from a julian day to unix
 ArrayValue localtime(Env env, 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(Env env, java.lang.String format, long phpTime)
          Returns the formatted date.
 Value strtotime(Env env, java.lang.String timeString, long now)
          Parses the time
static long time(Env env)
          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)
           
 
Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule
addConstant, addConstant, addConstant, getIniDefinitions
 
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

getLoadedExtensions

public java.lang.String[] getLoadedExtensions()
Returns true for the date extension.

Specified by:
getLoadedExtensions in interface QuercusModule
Overrides:
getLoadedExtensions in class AbstractQuercusModule

cal_days_in_month

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


checkdate

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


date

public java.lang.String date(Env env,
                             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(Env env,
                               int year)
Returns the timestamp of easter.


easter_days

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


getdate

public Value getdate(Env env,
                     Value timeV)
Returns an array of the current date.


gettimeofday

public Value gettimeofday(Env env,
                          boolean isFloatReturn)

gmdate

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


gmmktime

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


gmstrftime

public java.lang.String gmstrftime(Env env,
                                   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.


dateImpl

protected static java.lang.String dateImpl(java.lang.String format,
                                           long time,
                                           QDate calendar)
Returns the formatted date.


localtime

public ArrayValue localtime(Env env,
                            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(Env env,
                                 java.lang.String format,
                                 long phpTime)
Returns the formatted date.


strtotime

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


time

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


jdtounix

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


date_create

public static DateTime date_create(Env env,
                                   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(Env env,
                               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)

getConstMap

public java.util.Map<StringValue,Value> getConstMap()
Specified by:
getConstMap in interface QuercusModule
Overrides:
getConstMap in class AbstractQuercusModule