constructor Bs_Date [line 71]
method cleanDateArray [line 613]
array cleanDateArray(
array
$arr)
|
|
takes a date array and cleans its elements.
if these keys don't exist, they'll be added: 'year', 'month', 'day', 'hour', 'min', 'sec'
Tags:
Parameters:
method euDatetimeToSqlDatetime [line 820]
string euDatetimeToSqlDatetime(
[string
$euDatetime = ''])
|
|
converts a eu datetime into a sql datetime
Tags:
Parameters:
method euDatetimeToUnixTimestamp [line 444]
string euDatetimeToUnixTimestamp(
mixed
$euDatetime, string
$usDatetime)
|
|
converts a eu datetime into a unix timestamp. eg 19.2.2001 15:10:23 -> 982591823
we are NOT using php's built in strToTime() because it returns wrong dates for eu dates :( at least until now, 2001/02/20. hope it will improve. so we use some own php code.
for the date part, we use our own euDateToUnixTimestamp() method. then we create a us date with formatUnixTimestamp(). finally we convert the us date together with the time part to a timestamp using usDatetimeToUnixTimestamp().
i have tested it and a) performance is definitely NOT an issue, and b) it works quite well, even with a date like "15.3.1999 10:26:10" (note the extra spaces in the middle).
Tags:
Parameters:
method euDatetimeToUsDatetime [line 790]
string euDatetimeToUsDatetime(
[string
$euDatetime = ''])
|
|
converts a eu datetime into a us datetime
Tags:
Parameters:
method euDateToArray [line 504]
array euDateToArray(
string
$euDate)
|
|
converts a eu date into an array.
this method does not use the unix-timestamp, so there is no limitation in the time range.
Tags:
Parameters:
method euDateToSqlDate [line 835]
string euDateToSqlDate(
[string
$euDate = ''])
|
|
converts a eu date into a sql date
Tags:
Parameters:
method euDateToUnixTimestamp [line 653]
string euDateToUnixTimestamp(
mixed
$euDate, string
$usDatetime)
|
|
converts a eu date into a unix timestamp. eg 19.2.2001 -> 982591823
we are NOT using php's built in strToTime() because it returns wrong dates for eu dates :( at least until now, 2001/02/20. hope it will improve. so we use some own php code.
Tags:
Parameters:
method euDateToUsDate [line 805]
string euDateToUsDate(
[string
$euDate = ''])
|
|
converts a eu date into a us date
Tags:
Parameters:
method euTimeToUnixTimestamp [line 709]
string euTimeToUnixTimestamp(
string
$euTime)
|
|
converts a eu time into a unix timestamp. 15:10:23 ->
because the time looks the same in all versions (us, eu, sql) all these methods are using timeToUnixTimestamp().
Tags:
Parameters:
method formatArray [line 121]
string formatArray(
[string
$style = 'eu-2'], [array
$array = NULL])
|
|
returns a date-array formatted as a date, time or datetime.
this method uses getFormatForStyle().
Tags:
Parameters:
method formatEuDatetime [line 253]
string formatEuDatetime(
[string
$style = 'eu-2'], [string
$euDatetime = NULL])
|
|
returns a eu datetime formatted as any datetime, eg 27.8.1999 13:39:36 -> 1999/08/27 13:39:36 this method makes use of formatUnixTimestamp(), so watch out for the $style options.
Tags:
Parameters:
method formatSqlDatetime [line 271]
string formatSqlDatetime(
[string
$style = 'eu-2'], [string
$sqlDatetime = NULL])
|
|
returns a sql datetime formatted as any datetime, eg 1999-08-27 13:39:36 -> 27.8.1999 13:39:36 this method makes use of formatUnixTimestamp(), so watch out for the $style options.
Tags:
Parameters:
method formatSqlTimestamp [line 289]
string formatSqlTimestamp(
[string
$style = 'eu-2'], [string
$sqlTimestamp = NULL])
|
|
returns a mysql timestamp formatted as a datetime, eg 19990827133936 -> 27.08.1999 13:39:36 this method makes use of formatUnixTimestamp(), so watch out for the $style options.
Tags:
Parameters:
method formatUnixTimestamp [line 100]
string formatUnixTimestamp(
[string
$style = 'eu-2'], [string
$unixTimestamp = NULL])
|
|
returns a unix timestamp formatted as a datetime, eg 982591823 -> 19.02.2001 15:10:23.
this method uses getFormatForStyle().
Parameters:
method formatUsDatetime [line 235]
string formatUsDatetime(
[string
$style = 'eu-2'], [string
$usDatetime = NULL])
|
|
returns a us datetime formatted as any datetime, eg 1999/08/27 13:39:36 -> 27.08.1999 13:39:36 this method makes use of formatUnixTimestamp(), so watch out for the $style options.
Tags:
Parameters:
method getFormatForStyle [line 163]
string getFormatForStyle(
[string
$style = 'eu-2'])
|
|
takes a style definition and returns the format for it. see below.
possible values for the $style param:
'eu-1' -> dd.mm.yyyy hh:mm:ss 'eu-2' -> dd.mm.yyyy hh:mm 'eu-3' -> dd.mm.yyyy 'eu-4' -> hh:mm:ss 'eu-5' -> hh:mm
'us-1' -> yyyy/mm/dd hh:mm:ss 'us-2' -> yyyy/mm/dd hh:mm 'us-3' -> yyyy/mm/dd 'us-4' -> hh:mm:ss 'us-5' -> hh:mm
'sql-1' -> yyyy-mm-dd hh:mm:ss 'sql-2' -> yyyy-mm-dd hh:mm 'sql-3' -> yyyy-mm-dd 'sql-4' -> hh:mm:ss 'sql-5' -> hh:mm
'ts-1' -> yyyymmddhhmmss
note that 'sql' is the same format as 'iso', but there is no such alias. we're not gangsters we don't need aliases, right? :-)
Tags:
Parameters:
method getSeparator [line 588]
string getSeparator(
string
$date)
|
|
tries to find the separator used in a date.
example: 2002/12/31 => / 31.12.2002 => .
Tags:
Parameters:
method monthNumberToString [line 1030]
string monthNumberToString(
int
$month, [string
$lang = 'en'], [string
$type = 'long'])
|
|
converts a numerical month value to a string.
the following languages are supported: en
example: $month = monthNumberToString(12); //returns 'December' $month = monthNumberToString(12, 'en', $type='short'); //returns 'Dec'
Tags:
Parameters:
method monthStringToNumber [line 924]
mixed monthStringToNumber(
string
$month, [bool
$zeroFill = FALSE])
|
|
converts a month like 'Feb' or 'February' into a numerical month value (2).
takes the param $month in the languages:
- english en - danish da
- french fr - italian it
- german de - spanish es
- dutch nl - portuguese pt
you don't need to "normalize" strings, eg 'février' to 'fevrier'.
for details see db-table bs_kb.LangMonth.
Tags:
Parameters:
method monthToInt [line 1009]
void monthToInt(
mixed
$month, [mixed
$zeroFill = FALSE])
|
|
use monthStringToNumber instead.
Tags:
method now [line 85]
returns the current datetime in us style.
this function is an alias for this->formatUnixTimestamp('us-1')
Tags:
method sqlDatetimeToEuDatetime [line 882]
string sqlDatetimeToEuDatetime(
string
$sqlDatetime)
|
|
converts a sql datetime into a european datetime
Tags:
Parameters:
method sqlDatetimeToUnixTimestamp [line 392]
string sqlDatetimeToUnixTimestamp(
string
$sqlDatetime)
|
|
converts a sql datetime into a unix timestamp. eg 2001-02-19 15:10:23 -> 982591823
we are using php's built in strToTime(). hope it will get better...
Tags:
Parameters:
method sqlDatetimeToUsDatetime [line 850]
string sqlDatetimeToUsDatetime(
[string
$sqlDatetime = ''])
|
|
converts a sql datetime into a us datetime eg '2001-02-28 20:54:23' -> '2001/02/28 20:54:23'
Tags:
Parameters:
method sqlDateToArray [line 546]
array sqlDateToArray(
string
$sqlDate)
|
|
converts a sql date into an array.
this method does not use the unix-timestamp, so there is no limitation in the time range.
Tags:
Parameters:
method sqlDateToEuDate [line 897]
string sqlDateToEuDate(
[string
$sqlDate = ''])
|
|
converts a sql date into a eu date
Tags:
Parameters:
method sqlDateToUnixTimestamp [line 407]
string sqlDateToUnixTimestamp(
string
$sqlDate)
|
|
converts a sql date into a unix timestamp. eg 2001-02-19 ->
we are using php's built in strToTime(). hope it will get better...
Tags:
Parameters:
method sqlDateToUsDate [line 867]
string sqlDateToUsDate(
[string
$sqlDate = ''])
|
|
converts a sql date into a us date
Tags:
Parameters:
method sqlTimestampToUnixTimestamp [line 306]
string sqlTimestampToUnixTimestamp(
string
$sqlTimestamp)
|
|
converts an sql timestamp into a unix timestamp. eg 20010219151023 -> 982591823
Tags:
Parameters:
method sqlTimeToUnixTimestamp [line 422]
string sqlTimeToUnixTimestamp(
string
$sqlTime)
|
|
converts a sql time into a unix timestamp. 15:10:23 ->
because the time looks the same in all versions (us, eu, sql) all these methods are using timeToUnixTimestamp().
Tags:
Parameters:
method timeToUnixTimestamp [line 328]
string timeToUnixTimestamp(
string
$time)
|
|
converts a time into a unix timestamp. 15:10:23 -> 984665423
this function gets used by usDateToUnixTimestamp(), euDateToUnixTimestamp(), sqlDateToUnixTimestamp() because the time looks the same in all of these versions (us, eu, sql). the day, month and year of the returned timestamp will be from the current date.
we are using php's built in strToTime(). hope it will get better... but should be ok for the time stuff.
Tags:
Parameters:
method usDatetimeToEuDatetime [line 721]
string usDatetimeToEuDatetime(
[string
$usDatetime = ''])
|
|
converts a us datetime into a european datetime
Tags:
Parameters:
method usDatetimeToSqlDatetime [line 760]
string usDatetimeToSqlDatetime(
[string
$usDatetime = ''])
|
|
converts a us datetime into a sql datetime
Tags:
Parameters:
method usDatetimeToUnixTimestamp [line 342]
string usDatetimeToUnixTimestamp(
string
$usDatetime)
|
|
converts a us datetime into a unix timestamp. eg 2001/02/19 15:10:23 -> 982591823
we are using php's built in strToTime(). hope it will get better...
Tags:
Parameters:
method usDateToEuDate [line 741]
string usDateToEuDate(
[string
$usDate = ''])
|
|
converts a us date into a european date
Tags:
Parameters:
method usDateToSqlDate [line 775]
string usDateToSqlDate(
[string
$usDate = ''])
|
|
converts a us date into a sql date
Tags:
Parameters:
method usDateToUnixTimestamp [line 362]
string usDateToUnixTimestamp(
string
$usDate)
|
|
converts a us date into a unix timestamp. eg 2001/02/19 ->
we are using php's built in strToTime(). hope it will get better...
Tags:
Parameters:
method usTimeToUnixTimestamp [line 377]
string usTimeToUnixTimestamp(
string
$usTime)
|
|
converts a us time into a unix timestamp. 15:10:23 ->
because the time looks the same in all versions (us, eu, sql) all these methods are using timeToUnixTimestamp().
Tags:
Parameters: