MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
Referência à classe MKrono

Membros públicos

 __construct ($lan='it', $dateFormat='it', $timeFormat='it', $separator='/')
 
 _checkIniFile ()
 
 exitOnError ()
 
 _update ()
 
 _format ()
 
 _language ()
 
 _debug ()
 
 _disclaimer ()
 
 _isDaylight ($time)
 
 dayToN ($day)
 
 NToDay ($day)
 
 monthToN ($month)
 
 NToMonth ($month)
 
 isDay ($data, $day)
 
 dateToTimestamp ($date)
 
 daysDiff ($data_ini, $data_fin)
 
 timesDiff ($time_from, $time_to, $result_in="m")
 
 timesAdd ($time, $add, $what)
 
 howTo ($data)
 
 howDays ($data_ini, $data_fin, $day)
 
 kMkTime ($exp)
 
 atomDate ($date, $atom)
 
 kDate ($format="%l %d %F %Y", $timestamp=0)
 
 operation ($operator, $date, $operand)
 
 netTimestamp ($server='time-a.nist.gov', $port=37)
 
 swatchTime ()
 
 mysql_time_easy ($timestamp, $mode='mysqlfrom')
 
 getNthDay ($number, $weekday, $month, $year=0)
 
 romanDate ($date)
 
 yearMoonPhases ($Y)
 
 todayMoonPhase ($date='')
 
 getSunTime ($latitude=0, $longitude=0, $timezone=1, $location='IT|Roma', $daylight=1, $date='')
 
 pg_time_easy ($timestamp)
 
 timeToText ($seconds, $format="h")
 
 secsToTime ($secs)
 
 isValid ($date)
 
 getInfo ($date, $what, $format="short")
 
 InvertDate ($date=null)
 
 CompareDate ($dateA, $operator, $dateB)
 
 GetDay ($date)
 
 GetMonth ($date)
 
 GetYear ($date)
 
 Between ($date1, $date, $date2)
 
 makeTime ()
 

Campos de Dados

 $dayNameExt
 
 $dayNameCon
 
 $monthNameExt
 
 $monthNameCon
 
 $dataFrom
 
 $dataTo
 
 $error
 
 $abbr
 
 $lan
 
 $version ='0.7'
 
 $dateFormat
 
 $timeFormat
 
 $separator
 
 $path
 

Descrição detalhada

Class for compute some calculations on date and time

Versão
$Id class.kronos.php,v 0.7 2003/09/09 16.35.00(CET) marms Exp $ Holosoft Home Page http://lafucina.holosoft.it/kronoclass/ KronoClass Home at Author's Site http://www.phpclasses.org/browse.html/package/943.html KronoClass Home at phpclasses http://freshmeat.net/projects/kronoclass/?topic_id=914 KronoClass Home at freshmeat

Definido na linha 48 do ficheiro mkrono.class.

Documentação dos Construtores & Destrutor

◆ __construct()

__construct ( $lan = 'it',
$dateFormat = 'it',
$timeFormat = 'it',
$separator = '/' )

Constructor @access public

Veja também
Krono::$dateFormat
Parâmetros
string$lanThe language to use for month/day names
string$dateFormatthe format for date
char$separatorCharacter to use as date separator
Retorna
void

Definido na linha 137 do ficheiro mkrono.class.

Documentação das funções

◆ _checkIniFile()

_checkIniFile ( )

Function that check if ini files for languages exists @access private @reutrn void

Definido na linha 175 do ficheiro mkrono.class.

◆ _debug()

_debug ( )

Print out some debug information @access: private

Retorna
void

Definido na linha 273 do ficheiro mkrono.class.

◆ _disclaimer()

_disclaimer ( )

Print out a disclaimer @access private

Retorna
void

Definido na linha 286 do ficheiro mkrono.class.

◆ _format()

_format ( )

Return the format string for date function according to dateFormat parameter and separator @access private

Retorna
string

Definido na linha 217 do ficheiro mkrono.class.

◆ _isDaylight()

_isDaylight ( $time)

Return if a given time is daylight saving or not @access private

Retorna
int 1 if time is daylight saving 0 otherwise.

Definido na linha 298 do ficheiro mkrono.class.

◆ _language()

_language ( )

Return the literal name of language code @access private

Retorna
string The long name of language format

Definido na linha 250 do ficheiro mkrono.class.

◆ _update()

_update ( )

Return the last modified date of class file @access private

Retorna
string The formatted date of this file last modified field

Definido na linha 207 do ficheiro mkrono.class.

◆ atomDate()

atomDate ( $date,
$atom )

Return a single component of given date according to format in dateFormat date example with hour: 03/05/2003 23:43:00 (use only ':' as time separator) @access public

Retorna
date
Parâmetros
dateto extract atom from
atom->
  • 'm' for return month;
  • 'd' for return day;
  • 'y' for return last two number of year
  • 'Y' for return entire year
  • 'h' for hours
  • 'i' for minutes
  • 's' for seconds

Definido na linha 752 do ficheiro mkrono.class.

◆ Between()

Between ( $date1,
$date,
$date2 )

Definido na linha 1858 do ficheiro mkrono.class.

◆ CompareDate()

CompareDate ( $dateA,
$operator,
$dateB )

Definido na linha 1806 do ficheiro mkrono.class.

◆ dateToTimestamp()

dateToTimestamp ( $date)

Trasform a classical date format in unix timestamp format.

  • date according to dateFormat and timeFormat parameter passed on inizialization
  • Remember that unix timestamp is the amount of seconds since 1/1/1970 @access public
    Parâmetros
    date$dateThe date to transform
    Retorna
    timestamp The date transformed in timestamp

Definido na linha 471 do ficheiro mkrono.class.

◆ daysDiff()

daysDiff ( $data_ini,
$data_fin )

Define what's the day difference between two given date.

  • date according to dateFormat parameter passed on inizialization @access public
    Parâmetros
    date$data_iniThe start date
    date$data_finThe end date
    Retorna
    int The difference in days between the two given dates

Definido na linha 500 do ficheiro mkrono.class.

◆ dayToN()

dayToN ( $day)

Convert the name of a day in its numerical value.

  • i.e.: Monday stay for 0, Saturday stay for 6 @access public
    Parâmetros
    string$dayThe name of day, short or long.
    Retorna
    int the number of day

Definido na linha 345 do ficheiro mkrono.class.

◆ exitOnError()

exitOnError ( )

Function that exit with the error message if given @access private

Retorna
void

Definido na linha 194 do ficheiro mkrono.class.

◆ GetDay()

GetDay ( $date)

Definido na linha 1840 do ficheiro mkrono.class.

◆ getInfo()

getInfo ( $date,
$what,
$format = "short" )

Function that give some information on a date

  • in according with dateFormat @access public
    Parâmetros
    string$dateThe date to extract info
    string$whatWhat info to extract from date given (in any case)
    • "monthname" give the name of month
    • "dayname" give the name of day
    • "dayofweek" give the ordinal number of day in the week (1 for Sunday, 1 for Monday, and so on)
    • "dayofyear" give the ordinal number of day in the year
    • "week" give the number of week in the year
    • "trimester" give the number of trimester in the year
    string$formatFor textual information, specify if out in the short or long format +"short" or "s" for the short format (default) +"long" or "l" for the long format
    Retorna
    string The information asked

Definido na linha 1739 do ficheiro mkrono.class.

◆ GetMonth()

GetMonth ( $date)

Definido na linha 1846 do ficheiro mkrono.class.

◆ getNthDay()

getNthDay ( $number,
$weekday,
$month,
$year = 0 )

Get the date of Nth day of the month ..

  • example: what is the date of the 2nd Sunday of April 2003 ???
    @access public
    Retorna
    date The date
    Parâmetros
    int$numberThe ordinal value to get date
    string$weekdayThe name of day given in Long or short format
    mixed$monththe name or number of month
    int$yearthe year number

Definido na linha 1085 do ficheiro mkrono.class.

◆ getSunTime()

getSunTime ( $latitude = 0,
$longitude = 0,
$timezone = 1,
$location = 'IT|Roma',
$daylight = 1,
$date = '' )

Return the sunset or sunrise for the given date and geo location.

  • note: the method called without parameter return the sunrise and sunset of Rome (Italy) with daylight actived @access public
    Retorna
    string
    Parâmetros
    int$latitudeStay for latitude
    int$longitudeStay for longitude
    int$timezoneIs the timezone referred to GMT
    • (ie: for Italy is 1, for Spain is -1 and so on)
    string$locationIf don't know the geographical coordinates of your city give the name of location. (Support only Italian cities)
    int$daylight
    • '1' or 'on' if the location use daylight saving time
      • '0' or 'off' if the location doesn't use daylight saving time
    string$dateThe date to calc sunset/sunrise on

Definido na linha 1320 do ficheiro mkrono.class.

◆ GetYear()

GetYear ( $date)

Definido na linha 1852 do ficheiro mkrono.class.

◆ howDays()

howDays ( $data_ini,
$data_fin,
$day )

Define how many days (give it in name format) are in period given.

  • i.e.: How friday are from Nov,1 2002 to Mar,23 2003 ? @access public
    Parâmetros
    date$data_iniThe start date
    date$data_finThe end date
    string$dayThe name of day for calculating on
    Retorna
    int The number of day in the period given

Definido na linha 694 do ficheiro mkrono.class.

◆ howTo()

howTo ( $data)

Define how days left to given date. date according to dateFormat parameter passed on inizialization @access public

Parâmetros
date$dataThe date in traditional format for calculating diff
Retorna
int The amount of days between today and given date

Definido na linha 670 do ficheiro mkrono.class.

◆ InvertDate()

InvertDate ( $date = null)

Definido na linha 1796 do ficheiro mkrono.class.

◆ isDay()

isDay ( $data,
$day )

Define if the day of date given is equal to day given.

  • Is Friday the 22nd of November 2002 ?
  • date according to dateFormat parameter passed on inizialization @access public
    Parâmetros
    date$dataThe date to check
    string$dayThe name of day to check
    Retorna
    mixed 1 if check is true, otherwise the day of date

Definido na linha 444 do ficheiro mkrono.class.

◆ isValid()

isValid ( $date)

Function that check the validity of a date and/or time

Definido na linha 1638 do ficheiro mkrono.class.

◆ kDate()

kDate ( $format = "%l %d %F %Y",
$timestamp = 0 )

Date like function. Using the same format functionality @access public

Retorna
string The date according with format given
Parâmetros
stringformat ->
  • valid format parameter:
  • l (L lowercase): Day textual long
  • d: Day of month, 2 digits with leading zeros
  • F: Month textual Long
  • Y: Year, 4 digits
  • y: Year, 2 digits
  • m: Month numeric, 2 digits with leading zeros
  • D: Day textual short
  • M: Month textual short
  • n: Month numeric, without leading zeros
  • j: Day of month, without leading zeros
timestamp$timestampThe time to transform

Definido na linha 833 do ficheiro mkrono.class.

◆ kMkTime()

kMkTime ( $exp)

Work like php native mktime() but with date accordingly to format used @access private

Parâmetros
array$expThe date to transform
Retorna
timestamp The timestamp calculated on date given

Definido na linha 721 do ficheiro mkrono.class.

◆ makeTime()

makeTime ( )

Definido na linha 1869 do ficheiro mkrono.class.

◆ monthToN()

monthToN ( $month)

Convert the name of a month in its numerical value.

  • i.e.: February stay for 2, December stay for 12 @access public
    Parâmetros
    string$monthThe name of month, short or long format, in language setted by constructor
    Retorna
    int The number rappresenting the month

Definido na linha 392 do ficheiro mkrono.class.

◆ mysql_time_easy()

mysql_time_easy ( $timestamp,
$mode = 'mysqlfrom' )

Transform a MySQL like timestamp to a readable format (and viceversa)

  • ie: 20011210002745 -> December 10, 2001, 12:27 am @access public
    Retorna
    string The timestamp or the date in readable format
    Parâmetros
    timestamp$timestampThe mysql timestamp or date
    string$modemysqlfrom (convert mysql timestamp to readable format)
    string$modemysqlto (convert a date in readable format to mysql timestamp)

Definido na linha 1043 do ficheiro mkrono.class.

◆ netTimestamp()

netTimestamp ( $server = 'time-a.nist.gov',
$port = 37 )

Return the timestamp from a NIST TIME SERVER on the net. Get the atomic time!

  • attention
  • have to stay on line for work!! @access public
    Retorna
    timestamp The timestamp from internet

Definido na linha 996 do ficheiro mkrono.class.

◆ NToDay()

NToDay ( $day)

Convert the numerical value of a day in its name for the setted language by constructor.

  • Short o long format is choosed by setting the abbr value to true o false @access public
    Parâmetros
    int$dayThe number of day, 0 stay for Sunday and 6 for Saturday
    Retorna
    string the name of day in language setted by constructor

Definido na linha 372 do ficheiro mkrono.class.

◆ NToMonth()

NToMonth ( $month)

Convert the numerical value of a month in its name.

  • Short o long format is choosed by setting the abbr value to true o false @access public
    Parâmetros
    string$monthThe number of month
    Retorna
    string The name of month in language setted by constructor

Definido na linha 421 do ficheiro mkrono.class.

◆ operation()

operation ( $operator,
$date,
$operand )

Definido na linha 902 do ficheiro mkrono.class.

◆ pg_time_easy()

pg_time_easy ( $timestamp)

Definido na linha 1486 do ficheiro mkrono.class.

◆ romanDate()

romanDate ( $date)

Return the date in ancient roman date format

  • note: the date is output in the form: ddmmyyyy without separator.Support maximum to 5000 years!!! @access public
    Retorna
    string The date in roman format
    Parâmetros
    date$dateThe date to transform

Definido na linha 1153 do ficheiro mkrono.class.

◆ secsToTime()

secsToTime ( $secs)

Function to turn seconds into a time

Definido na linha 1609 do ficheiro mkrono.class.

◆ swatchTime()

swatchTime ( )

Returns the current time in swatch .beat format. Remember that 1000 beats = 24 hours @access public

Retorna
string The swatch beat time

Definido na linha 1018 do ficheiro mkrono.class.

◆ timesAdd()

timesAdd ( $time,
$add,
$what )

Add some minutes or hours to a given time.

  • i.e.: (add 2 hours to 14.10 -> result is 16.10)
  • Accept only 24H format.
  • the time is a string like: "4.50" or "4:50"
    Parâmetros
    string$timeThe time string to transform
    int$addThe hours or minutes to add
    char$whatis what add to time
  • "m" -> for add minutes
  • "h" -> for add hours
  • "t" -> for add time string given in HH:mm format
    Retorna
    string Result is in format HH:mm, return -1 on error

Definido na linha 593 do ficheiro mkrono.class.

◆ timesDiff()

timesDiff ( $time_from,
$time_to,
$result_in = "m" )

Give the difference between two times.

  • (i.e.: how minutes from 4.50 to 12.50?).
  • Accept only 24H format.
  • the time is a string like: "4.50" or "4:50" @access public
    Parâmetros
    string$time_fromThe start time
    string$time_toThe end time
    char$result_inThe format of result
  • "m" -> for minutes
  • "s" -> for seconds
  • "h" -> for hours
    Retorna
    string The difference between times according to format given in $result_in

Definido na linha 531 do ficheiro mkrono.class.

◆ timeToText()

timeToText ( $seconds,
$format = "h" )

Return the literal value of a unix timestamp or seconds

  • i.e.: so 3670 seconds mean 1 hour, 1 minute and 10 seconds.
    Parâmetros
    int$secondsNumber of seconds to transform.
    char$formatThe format of output, +"h" for hours.minutes.seconds (short form) +"d" for year.months.days.etc (short form) +"H" for hours.minutes.seconds (long form) +"D" for year.months.days.etc (long form) @access public
    Retorna
    string The seconds transformed in text

Definido na linha 1509 do ficheiro mkrono.class.

◆ todayMoonPhase()

todayMoonPhase ( $date = '')

Definido na linha 1283 do ficheiro mkrono.class.

◆ yearMoonPhases()

yearMoonPhases ( $Y)

Returns an array with all the phases of the moon for a whole year @access public

Parâmetros
int$Yis the year to get moon phases.
Retorna
array The moonphase for each day

Definido na linha 1198 do ficheiro mkrono.class.

Documentação dos campos e atributos

◆ $abbr

$abbr

Variable for choose long or short day names format @access public

Definido na linha 88 do ficheiro mkrono.class.

◆ $dataFrom

$dataFrom

General purpose use @access private

Definido na linha 73 do ficheiro mkrono.class.

◆ $dataTo

$dataTo

General purpose use @access private

Definido na linha 78 do ficheiro mkrono.class.

◆ $dateFormat

$dateFormat

Set to desidered date format @access public

  • possible values:
  • it -> italian (dd-mm-yyyy)
  • en,std -> international (mm-dd-yyyy)
  • ansi -> used in dbase and other source (yyyy-mm-dd)

Definido na linha 108 do ficheiro mkrono.class.

◆ $dayNameCon

$dayNameCon

Array that contain the name of days in short format @access private

Definido na linha 58 do ficheiro mkrono.class.

◆ $dayNameExt

$dayNameExt

Array that contain the name of days in long format * @access private

Definido na linha 53 do ficheiro mkrono.class.

◆ $error

$error

Used for errors @access private

Definido na linha 83 do ficheiro mkrono.class.

◆ $lan

$lan

Set to desidered language @access public

Definido na linha 93 do ficheiro mkrono.class.

◆ $monthNameCon

$monthNameCon

Array that contain the name of month in short format @access private

Definido na linha 68 do ficheiro mkrono.class.

◆ $monthNameExt

$monthNameExt

Array that contain the name of month in long format @access private

Definido na linha 63 do ficheiro mkrono.class.

◆ $path

$path

Char for path of ini files @access public

Definido na linha 127 do ficheiro mkrono.class.

◆ $separator

$separator

Char for separating date @access public

Definido na linha 122 do ficheiro mkrono.class.

◆ $timeFormat

$timeFormat

Set to desidered time format @access public

  • possible values:
  • 24,it -> italian format 24H ie: 20.17, 9.11
  • 12,en -> international 12H ie: 8.17PM, 9.11AM

Definido na linha 117 do ficheiro mkrono.class.

◆ $version

$version ='0.7'

Version number @access private

Definido na linha 98 do ficheiro mkrono.class.


A documentação para esta classe foi gerada a partir do seguinte ficheiro: