PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ibase_trans> <ibase_set_event_handler
Last updated: Fri, 10 Oct 2008

view this page in

ibase_timefmt

(PHP 4)

ibase_timefmtクエリから返される timestamp、data、time 型カラムのフォーマットを設定する

説明

bool ibase_timefmt ( string $format [, int $columntype ] )

クエリから返される timestamp、data、time 型カラムのフォーマットを設定します。

PHP 設定ディレクティブ ibase.timestampformatibase.dateformat および ibase.timeformat によりこれらのフォーマットのデフォルト値を設定することが可能です。

注意: この関数は PHP 5 で削除されました。かわりに ini_set() を使用してください。

パラメータ

format

内部的にこれらのカラムは C 言語の関数 strftime() により フォーマットされます。このため、文字列のフォーマットについては この C 言語の関数ドキュメントを参照ください。

columntype

columntypeIBASE_TIMESTAMPIBASE_DATE および IBASE_TIME のいずれかとなります。 省略した場合は、下位互換性を保つために IBASE_TIMESTAMP を使用します。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 ibase_timefmt() の例

<?php
/* InterBase 6 TIME型カラムが
 * '05 hours 37 minutes'の形式で返されます */
ibase_timefmt("%H hours %M minutes"IBASE_TIME);
?>



add a note add a note User Contributed Notes
ibase_timefmt
slynko at gmail dot com
03-Feb-2006 05:21
I use this code (for easy migration from PHP4 to PHP5):

/**
 * Constant definitions that has been removed from PHP 5
*/
const IBASE_DATE = "ibase.dateformat";
const IBASE_TIME = "ibase.timeformat";
const IBASE_TIMESTAMP = "ibase.timestampformat";

/**
 * Sets the format of timestamp, date or time type
 * columns returned from queries
*/
function ibase_timefmt($format, $where = IBASE_TIMESTAMP)
{
 ini_set($where, $format);
}

ibase_trans> <ibase_set_event_handler
Last updated: Fri, 10 Oct 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites