time()然后系统时间的UNIX时间戳然后就可以用date函数了

解决方案 »

  1.   

    date() 例子<?php
    // 设定要用的默认时区。自 PHP 5.1 可用
    date_default_timezone_set('UTC');
    // 输出类似:Monday
    echo date("l");// 输出类似:Monday 15th of August 2005 03:12:46 PM
    echo date('l dS \of F Y h:i:s A');// 输出:July 1, 2000 is on a Saturday
    echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));/* 在格式参数中使用常量 */
    // 输出类似:Mon, 15 Aug 2005 15:12:46 UTC
    echo date(DATE_RFC822);// 输出类似:2000-07-01T00:00:00+00:00
    echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000));
    ?>