php学习视频017日期和时间演示文档(php制作日期计算器)

<?php

//*

//* 日期、时间

//*

date_default_timezone_set( 'PRC' );

//echo date( 'h:i:s', time() );

//本地化时间戳

//echo mktime( 1, 1, 1, 3 );

//当前时间戳

//echo time();

//获取当前日期和时间

//echo date( 'Y-m-d h:i:s', time() );

//获取日期信息

//$tm = getDate();

//print_r( $tm );

//echo $tm['mon'];

//检验日期的有效性

//$res = checkDate( 2, 3, 2021 );

//var_dump( $res );

//显示本地化的日期和时间

//echo setLocale( LC_ALL, "US" );

//echo '</p>';

//echo setLocale( LC_ALL, NULL );

//将日期和时间解析为UNIX时间戳

//echo strtotime( 'now' );

//echo strtotime( '+3 days' );

//echo strtotime( '2021/2/1' );

//echo strtotime( '9:24' ) – strtotime( '9:00' );

//echo '距离11点还有:' . ( strtotime( '11:00' ) – time() ) . ' 秒';

//$g = strtotime( '2021-10-01' );

//$res = ceil( ( $g – time() ) / ( 24 * 3600 ) );

//echo $res;

$start = microtime();

$arr = range( 1, 100000 );

//print_r( $arr );

$end = microtime();

echo '</p>';

$start = explode( ' ', $start );

$end = explode( ' ', $end );

echo ( (int)$end[1] – (int)$start[1] ) + ( $end[0] – $start[0] );

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注