core
[ class tree: core ] [ index: core ] [ all elements ]

Class: DateFormatter

Source Location: /core/DateFormatter.class.php

Class Overview

ABSTObject
   |
   --DateFormatter

Static methods mainly to compute dates depending on weeknum for industrial


Author(s):

Version:

  • 0.2.11

Copyright:

  • Copyright (c) 2003 Daniel Plücken <daniel@debakel.net>

    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License.

    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Methods


Inherited Methods

Class: ABSTObject

ABSTObject::printComplexData()
Prints out the more complex data by the given array.
ABSTObject::printPrimitiveData()
Prints out the primitive data by the given arrays.
ABSTObject::printStructure()
Prints out the Structure of this Object.
ABSTObject::same()
Checks whether the passed object reference points to this object.
ABSTObject::sameReferences()
Compares two references whether they points to the same object

Class Details

[line 93]
Static methods mainly to compute dates depending on weeknum for industrial

programs. The base standard is ISO 8601 (e.g. for german economy time pattern) http://en.wikipedia.org/wiki/ISO_8601#Week_dates




Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  0.2.11
copyright:  

Copyright (c) 2003 Daniel Plücken <daniel@debakel.net>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

license:  GNU Lesser General Public License


[ Top ]


Class Methods


static method extractWeekDayFromTimestamp [line 479]

static integer extractWeekDayFromTimestamp( integer $timestamp)

Returns the weekday as number of the week from given unix-timestamp.

Monday will be returned as zero. Sunday will returned as six.




Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.2
access:  public


Parameters:

integer   $timestamp  

[ Top ]

static method extractWeeknumFromTimestamp [line 498]

static integer extractWeeknumFromTimestamp( integer $timestamp)

Returns the extracted weeknum from a given timestamp.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.2
access:  public


Parameters:

integer   $timestamp  

[ Top ]

static method extractYearFromTimestampDependingOnWeeknum [line 521]

static integer extractYearFromTimestampDependingOnWeeknum( integer $timestamp)

Returns the extracted year that depends on a weeknum of a unix-timestamp.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.2
access:  public


Parameters:

integer   $timestamp  

[ Top ]

static method getDateOfWeekDayOfWeeknumOfYear [line 724]

static integer getDateOfWeekDayOfWeeknumOfYear( integer $weekday, integer $weeknum, integer $year)

Returns the date of the given weekday associated with the given calendar week and year as an array. The first entry of the returned array carries the day of the month and the second entry carries the month of the given year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $weekday  
integer   $weeknum  
integer   $year  

[ Top ]

static method getDaysCountOfMonthOfYear [line 566]

static integer getDaysCountOfMonthOfYear( $month, $year, integer $timestamp)

Returns the number of days from given month and year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.1
since:  0.1.1
access:  public


Parameters:

integer   $timestamp  
   $month  
   $year  

[ Top ]

static method getFirstSecondOfDayFromTimestamp [line 544]

static integer getFirstSecondOfDayFromTimestamp( integer $timestamp)

Returns the first second of a day from a unix-timestamp.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.8
access:  public


Parameters:

integer   $timestamp  

[ Top ]

static method getFridayDateOfWeeknumOfYear [line 837]

static integer getFridayDateOfWeeknumOfYear( integer $weeknum, integer $year)

Returns the date of the friday associated with the given calendar week and year as an array. The first entry of the returned array carries the day of the month and the second entry carries the month of the given year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $weeknum  
integer   $year  

[ Top ]

static method getMondayDateOfFirstWeekOfYear [line 641]

static integer getMondayDateOfFirstWeekOfYear( integer $year)

Returns the monday date of the first calendar week of a given year

according to ISO 8601: "The first week of a year is the first week which includes at least four days in the new year. Another way of putting this is that the first week of a year is the week which includes the first Thursday of January. It will also include January 4. This means that week 01 could include days from the previous year, or that week 53 could include days from the next year. For example, 2004-01-01 occurs on a Thursday. This means that 2004-W01 consists of 2003-12-29 through 2004-01-04. 2005-01-01 occurs on a Saturday, meaning that 2004-W53 is 2004-12-27 through 2005-01-02, and 2005-W01 starts on 2005-01-03." (http://en.wikipedia.org/wiki/ISO_8601#Week_dates)




Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $year  

[ Top ]

static method getMondayDateOfWeeknumOfYear [line 667]

static integer getMondayDateOfWeeknumOfYear( integer $weeknum, integer $year)

Returns the date of the monday associated with the given calendar week and year as an array. The first entry of the returned array carries the day of the month and the second entry carries the month of the given year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $weeknum  
integer   $year  

[ Top ]

static method getMonthFromWeeknumAndYear [line 951]

static integer getMonthFromWeeknumAndYear( integer $weeknum, integer $year)

Returns the number of month associated with the given calendar week and year. Beware! This function will not return the values between 1 and 12, because it could be that a given calendar week is a part of two month.

  1.  Here is the list of the definition:
  2.  
  3.         January
  4.         January February
  5.         February
  6.         February March
  7.         March
  8.         March April
  9.         April
  10.         April May
  11.         May
  12.         May June
  13.        10 June
  14.        11 June July
  15.        12 July
  16.        13 July August
  17.        14 August
  18.        15 August September
  19.        16 September
  20.        17 September October
  21.        18 October
  22.        19 October November
  23.        20 November
  24.        21 November December
  25.        22 December
  26.        23 December January




Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $weeknum  
integer   $year  

[ Top ]

static method getMonthNameFromWeeknumAndYear [line 976]

static string getMonthNameFromWeeknumAndYear( integer $weeknum, integer $year)

Returns the name of month associated with the given calendar week and year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.0
access:  public


Parameters:

integer   $weeknum  
integer   $year  

[ Top ]

static method getSaturdayDateOfWeeknumOfYear [line 859]

static integer getSaturdayDateOfWeeknumOfYear( integer $weeknum, integer $year)

Returns the date of the saturday associated with the given calendar week and year as an array. The first entry of the returned array carries the day of the month and the second entry carries the month of the given year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $weeknum  
integer   $year  

[ Top ]

static method getSundayDateOfWeeknumOfYear [line 881]

static integer getSundayDateOfWeeknumOfYear( integer $weeknum, integer $year)

Returns the date of the sunday associated with the given calendar week and year as an array. The first entry of the returned array carries the day of the month and the second entry carries the month of the given year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $weeknum  
integer   $year  

[ Top ]

static method getThursdayDateOfWeeknumOfYear [line 815]

static integer getThursdayDateOfWeeknumOfYear( integer $weeknum, integer $year)

Returns the date of the thursday associated with the given calendar week and year as an array. The first entry of the returned array carries the day of the month and the second entry carries the month of the given year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $weeknum  
integer   $year  

[ Top ]

static method getTimestampFromISODate [line 113]

static integer getTimestampFromISODate( string $str_iso_date)

Returns a timestamp from ISO date and time



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.2.0
access:  public


Parameters:

string   $str_iso_date  

[ Top ]

static method getTimestampFromWeeknumAndYear [line 606]

static integer getTimestampFromWeeknumAndYear( $weeknum, $year, integer $timestamp)

Returns the timestamp of the week's first second from a given calendar week and year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $timestamp  
   $weeknum  
   $year  

[ Top ]

static method getTranslatedDate [line 240]

static string getTranslatedDate( string $string, integer $timestamp_or_isodate)

Returns a language specified date based on the constant LANG with the rules of a date()-function.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.9
access:  public


Parameters:

string   $string  
integer   $timestamp_or_isodate   The unix-timestamp or ISO-8601 date that should be transformed.

[ Top ]

static method getTuesdayDateOfWeeknumOfYear [line 771]

static integer getTuesdayDateOfWeeknumOfYear( integer $weeknum, integer $year)

Returns the date of the tuesday associated with the given calendar week and year as an array. The first entry of the returned array carries the day of the month and the second entry carries the month of the given year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $weeknum  
integer   $year  

[ Top ]

static method getWednesdayDateOfWeeknumOfYear [line 793]

static integer getWednesdayDateOfWeeknumOfYear( integer $weeknum, integer $year)

Returns the date of the wednesday associated with the given calendar week and year as an array. The first entry of the returned array carries the day of the month and the second entry carries the month of the given year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $weeknum  
integer   $year  

[ Top ]

static method getWeekdaynameFromTimestamp [line 900]

static string getWeekdaynameFromTimestamp( integer $timestamp)

Returns weekday name associated with the given timestamp.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $timestamp  

[ Top ]

static method getWeeknumCountOfYear [line 1000]

static integer getWeeknumCountOfYear( integer $year)

Returns the number of weeks in a given year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.1
access:  public


Parameters:

integer   $year  

[ Top ]

static method isLeapYear [line 1032]

static boolean isLeapYear( integer $year)

Returns whether the given year is a leap year.



Tags:

author:  Daniel Plücken <daniel@debakel.net>
version:  1.0
since:  0.1.2
access:  public


Parameters:

integer   $year  

[ Top ]

static method str2time [line 151]

static integer str2time( string $strStr, [string $strPattern = null])

Returns a timestamp from a date.



Tags:

author:  Daniel Plücken <daniel@debakel.net> (only placed here)
author:  nicky
version:  1.0
see:  AEN21898
see:  67996
todo:  am and pm is unaccounted yet
since:  0.2.1
access:  public


Parameters:

string   $strStr   The date to konvert to unix timestamp.
string   $strPattern   The pattern how interpret the date to konvert it to unix timestamp.

[ Top ]

constructor DateFormatter [line 97]

DateFormatter DateFormatter( )



[ Top ]


Documentation generated on Thu, 05 Jun 2008 19:10:42 +0200 by phpDocumentor 1.4.1