Converter

Date/time conversion functionality.

category

VuFind

package

Date

author

Demian Katz demian.katz@villanova.edu

author

Luke O'Sullivan l.osullivan@swansea.ac.uk

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Methods

Constructor

__construct(array $config = array()) 

Arguments

$config

array

Configuration to use (omit to use defaults)

Generic method for conversion of a time / date string

convert(string $inputFormat, string $outputFormat, string $dateString) : string
Throws
\VuFind\Date\DateException

Arguments

$inputFormat

string

The format of the time string to be changed

$outputFormat

string

The desired output format

$dateString

string

The date string

Response

string

A re-formatted time string

Public method for conversion of an admin defined date string to a driver required date string

convertFromDisplayDate(string $outputFormat, string $displayDate) : string
Throws
\VuFind\Date\DateException

Arguments

$outputFormat

string

The format of the required date string

$displayDate

string

The display formatted date string

Response

string

A re-formatted date string

Convert a date string to admin-defined format.

convertToDisplayDate(string $createFormat, string $dateString) : string
Throws
\VuFind\Date\DateException

Arguments

$createFormat

string

The format of the date string to be changed

$dateString

string

The date string

Response

string

A re-formatted date string

Public method for getting a date prepended to a time.

convertToDisplayDateAndTime(string $createFormat, string $timeString, string $separator = ' ') : string
Throws
\VuFind\Date\DateException

Arguments

$createFormat

string

The format of the time string to be changed

$timeString

string

The time string

$separator

string

String between time/date

Response

string

A re-formatted time string

Public support method for conversion of a time string to admin defined time string.

convertToDisplayTime(string $createFormat, string $timeString) : string
Throws
\VuFind\Date\DateException

Arguments

$createFormat

string

The format of the time string to be changed

$timeString

string

The time string

Response

string

A re-formatted time string

Public method for getting a time prepended to a date.

convertToDisplayTimeAndDate(string $createFormat, string $timeString, string $separator = ' ') : string
Throws
\VuFind\Date\DateException

Arguments

$createFormat

string

The format of the time string to be changed

$timeString

string

The time string

$separator

string

String between time/date

Response

string

A re-formatted time string

Build an exception message from a detailed error array.

getDateExceptionMessage(array $details) : string

Arguments

$details

array

Error details

Response

string

Properties

Format string for dates

displayDateFormat : string
var

Type(s)

string

Format string for times

displayTimeFormat : string
var

Type(s)

string

Time zone to use for conversions

timezone : \DateTimeZone
var

Type(s)

\DateTimeZone