IntlDateFormatter::getTimeType

datefmt_get_timetype

(PHP 5 >= 5.3.0, PHP 7, PECL intl >= 1.0.0)

IntlDateFormatter::getTimeType -- datefmt_get_timetypeGet the timetype used for the IntlDateFormatter

说明

面向对象风格

public IntlDateFormatter::getTimeType ( void ) : int

过程化风格

datefmt_get_timetype ( IntlDateFormatter $fmt ) : int

Return time type used by the formatter.

参数

fmt

The formatter resource.

返回值

The current date type value of the formatter.

范例

Example #1 datefmt_get_timetype() example

<?php
$fmt 
datefmt_create(
    
'en_US',
    
IntlDateFormatter::FULL,
    
IntlDateFormatter::FULL,
    
'America/Los_Angeles',
    
IntlDateFormatter::GREGORIAN
);
echo 
'timetype of the formatter is : ' datefmt_get_timetype($fmt);
echo 
'First Formatted output with timetype is ' datefmt_format($fmt0);

$fmt datefmt_create(
    
'en_US',
    
IntlDateFormatter::FULL,
    
IntlDateFormatter::SHORT,
    
'America/Los_Angeles',
    
IntlDateFormatter::GREGORIAN
);
echo 
'Now timetype of the formatter is : ' datefmt_get_timetype($fmt);
echo 
'Second Formatted output with timetype is ' datefmt_format($fmt0);

?>

Example #2 OO example

<?php
$fmt 
= new IntlDateFormatter(
    
'en_US',
    
IntlDateFormatter::FULL,
    
IntlDateFormatter::FULL,
    
'America/Los_Angeles',
    
IntlDateFormatter::GREGORIAN
);
echo 
'timetype of the formatter is : ' $fmt->getTimeType();
echo 
'First Formatted output is ' $fmt->format(0);

$fmt = new IntlDateFormatter(
    
'en_US',
    
IntlDateFormatter::FULL,
    
IntlDateFormatter::SHORT,
    
'America/Los_Angeles',
    
IntlDateFormatter::GREGORIAN
);
echo 
'Now timetype of the formatter is : ' $fmt->getTimeType();
echo 
'Second Formatted output is ' $fmt->format(0);

?>

以上例程会输出:

timetype of the formatter is : 0
First Formatted output is Wednesday, December 31, 1969 4:00:00 PM PT
Now timetype of the formatter is : 3
Second Formatted output is Wednesday, December 31, 1969 4:00 PM

参见

相关文章
php frontbase 函数 get or set the database name used with a connectionphp maxdb 函数 returns the auto generated id used in the last queryphp imagickdraw returns the color used for stroking object outlinesphp imagickdraw specifies the shape to be used at the corners of paths when they are strokedphp intldateformatter get the calendar type used for the intldateformatterphp intldateformatter get the datetype used for the intldateformatterphp intldateformatter get the locale used by formatterphp intldateformatter get the pattern used for the intldateformatterphp intldateformatter get the timetype used for the intldateformatterphp intldateformatter get formatterʼs timezonephp intldateformatter get the timezone id used for the intldateformatterphp intldateformatter get the lenient used for the intldateformatterphp intldateformatter sets the calendar type used by the formatterphp intldateformatter set the pattern used for the intldateformatterphp mongo returns the address being used by this for slaveokay readsphp mysqlnduhconnection returns a string representing the type of connection usedphp sdo das relational 函数 returns the special root object in an otherwise empty data graph. used when creating a data graph from scratchphp solrquery returns an offset into the list of constraints to be used for paginationphp swoole mmap map a file into memory and return the stream resource which can be used by php stream operations.php swoole server used in task process for sending result to the worker process when the task is finished.
关注编程学问公众号