<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Date
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Date.php 2504 2011-12-28 07:35:29Z liu21st $
*/
/**
* Include needed Date classes
*/
require_once 'Zend/Date/DateObject.php';
require_once 'Zend/Locale.php';
require_once 'Zend/Locale/Format.php';
require_once 'Zend/Locale/Math.php';
/**
* @category Zend
* @package Zend_Date
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Date extends Zend_Date_DateObject
{
private $_locale = null;
// Fractional second variables
private $_fractional = 0;
private $_precision = 3;
private static $_options = array(
'format_type' => 'iso', // format for date strings 'iso' or 'php'
'fix_dst' => true, // fix dst on summer/winter time change
'extend_month' => false, // false - addMonth like SQL, true like excel
'cache' => null, // cache to set
'timesync' => null // timesync server to set
);
// Class wide Date Constants
const DAY = 'dd';
const DAY_SHORT = 'd';
const DAY_SUFFIX = 'SS';
const DAY_OF_YEAR = 'D';
const WEEKDAY = 'EEEE';
const WEEKDAY_SHORT = 'EEE';
const WEEKDAY_NARROW = 'E';
const WEEKDAY_NAME = 'EE';
const WEEKDAY_8601 = 'eee';
const WEEKDAY_DIGIT = 'e';
const WEEK = 'ww';
const MONTH = 'MM';
const MONTH_SHORT = 'M';
const MONTH_DAYS = 'ddd';
const MONTH_NAME = 'MMMM';
const MONTH_NAME_SHORT = 'MMM';
const MONTH_NAME_NARROW = 'MMMMM';
const YEAR = 'y';
const YEAR_SHORT = 'yy';
const YEAR_8601 = 'Y';
const YEAR_SHORT_8601 = 'YY';
const LEAPYEAR = 'l';
const MERIDIEM = 'a';
const SWATCH = 'B';
const HOUR = 'HH';
const HOUR_SHORT = 'H';
const HOUR_AM = 'hh';
const HOUR_SHORT_AM = 'h';
const MINUTE = 'mm';
const MINUTE_SHORT = 'm';
const SECOND = 'ss';
const SECOND_SHORT = 's';
const MILLISECOND = 'S';
const TIMEZONE_NAME = 'zzzz';
const DAYLIGHT = 'I';
const GMT_DIFF = 'Z';
const GMT_DIFF_SEP = 'ZZZZ';
const TIMEZONE = 'z';
const TIMEZONE_SECS = 'X';
const ISO_8601 = 'c';
const RFC_2822 = 'r';
const TIMESTAMP = 'U';
const ERA = 'G';
const ERA_NAME = 'GGGG';
const ERA_NARROW = 'GGGGG';
const DATES = 'F';
const DATE_FULL = 'FFFFF';
const DATE_LONG = 'FFFF';
const DATE_MEDIUM = 'FFF';
const DATE_SHORT = 'FF';
const TIMES = 'WW';
const TIME_FULL = 'TTTTT';
const TIME_LONG = 'TTTT';
const TIME_MEDIUM = 'TTT';
const TIME_SHORT = 'TT';
const DATETIME = 'K';
const DATETIME_FULL = 'KKKKK';
const DATETIME_LONG = 'KKKK';
const DATETIME_MEDIUM = 'KKK';
const DATETIME_SHORT = 'KK';
const ATOM = 'OOO';
const COOKIE = 'CCC';
const RFC_822 = 'R';
const RFC_850 = 'RR';
const RFC_1036 = 'RRR';
const RFC_1123 = 'RRRR';
const RFC_3339 = 'RRRRR';
const RSS = 'SSS';
const W3C = 'WWW';
/**
* Generates the standard date object, could be a unix timestamp, localized date,
* string, integer, array and so on. Also parts of dates or time are supported
* Always set the default timezone: http://php.net/date_default_timezone_set
* For example, in your bootstrap: date_default_timezone_set('America/Los_Angeles');
* For detailed instructions please look in the docu.
*
* @param string|integer|Zend_Date|array $date OPTIONAL Date value or value of date part to set
* ,depending on $part. If null the actual time is set
* @param string $part OPTIONAL Defines the input format of $date
* @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
* @return Zend_Date
* @throws Zend_Date_Exception
*/
public function __construct($date = null, $part = null, $locale = null)
{
if (is_object($date) and !($date instanceof Zend_TimeSync_Protocol) and
!($date instanceof Zend_Date)) {
if ($locale instanceof Zend_Locale) {
$locale = $date;
$date = null;
$part = null;
} else {
$date = (string) $date;
}
}
if (($date !== null) and !is_array($date) and !($date instanceof Zend_TimeSync_Protocol) and
!($date instanceof Zend_Date) and !defined($date) and Zend_Locale::isLocale($date, true, false)) {
$locale = $date;
$date = null;
$part = null;
} else if (($part !== null) and !defined($part) and Zend_Locale::isLocale($part, true, false)) {
$locale = $part;
$part = null;
}
$this->setLocale($locale);
if (is_string($date) && ($part === null) && (strlen($date) <= 5)) {
$part = $date;
$date = null;
}
if ($date === null) {
if ($part === null) {
$date = time();
} else if ($part !== self::TIMESTAMP) {
$date = self::now($locale);
$date = $date->get($part);
}
}
if ($date instanceof Zend_TimeSync_Protocol) {
$date = $date->getInfo();
$date = $this->_getTime($date['offset']);
$part = null;
} else if (parent::$_defaultOffset != 0) {
$date = $this->_getTime(parent::$_defaultOffset);
}
// set the timezone and offset for $this
$zone = @date_default_timezone_get();
$this->setTimezone($zone);
// try to get timezone from date-string
if (!is_int($date)) {
$zone = $this->getTimezoneFromString($date);
$this->setTimezone($zone);
}
// set datepart
if (($part !== null && $part !== self::TIMESTAMP) or (!is_numeric($date))) {
// switch off dst handling for value setting
$this->setUnixTimestamp($this->getGmtOffset());
$this->set($date, $part, $this->_locale);
// DST fix
if (is_array($date) === true) {
if (!isset($date['hour'])) {
$date['hour'] = 0;
}
$hour = $this->toString('H');
$hour = $date['hour'] - $hour;
switch ($hour) {
case 1 :
case -23 :
$this->addTimestamp(3600);
没有合适的资源?快使用搜索试试~ 我知道了~
PHP实例开发源码-网展PHP中英外贸企业网站黑色风格.zip
共1199个文件
php:529个
gif:303个
html:130个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 144 浏览量
2022-11-23
13:07:37
上传
评论
收藏 10.62MB ZIP 举报
温馨提示
PHP实例开发源码—网展PHP中英外贸企业网站黑色风格.zip PHP实例开发源码—网展PHP中英外贸企业网站黑色风格.zip PHP实例开发源码—网展PHP中英外贸企业网站黑色风格.zip
资源推荐
资源详情
资源评论
收起资源包目录
PHP实例开发源码-网展PHP中英外贸企业网站黑色风格.zip (1199个子文件)
php_xxtea.c 6KB
xxtea.c 2KB
web.config 582B
web.config 420B
CREDITS 53B
bootstrap.css 145KB
index.css 35KB
default.css 21KB
style.css 18KB
install.css 11KB
eonline.css 8KB
online.css 8KB
te_dialog.css 6KB
styles.css 4KB
base.css 4KB
TPMmodal.css 4KB
bxslider.css 4KB
lightbox.css 4KB
style.css 4KB
qq.css 3KB
simple.css 2KB
TPMlist.css 1KB
prettify.css 973B
prev.cur 4KB
next.cur 4KB
768.dhp 40KB
512.dhp 35KB
1024.dhp 32KB
1536.dhp 28KB
3072.dhp 28KB
2048.dhp 25KB
4096.dhp 25KB
96.dhp 20KB
128.dhp 18KB
160.dhp 14KB
192.dhp 12KB
256.dhp 10KB
php_xxtea.dsp 9KB
glyphicons-halflings-regular.eot 20KB
ico.gif 38KB
qq_face.gif 35KB
static.gif 35KB
title.gif 14KB
qq_face_35.gif 13KB
35.gif 13KB
qq_face_42.gif 13KB
42.gif 13KB
qq_face_40.gif 10KB
40.gif 10KB
bx_loader.gif 8KB
loading.gif 8KB
qq_face_18.gif 8KB
18.gif 8KB
qq_face_19.gif 8KB
19.gif 8KB
qq_face_11.gif 8KB
11.gif 8KB
qq_face_32.gif 7KB
32.gif 7KB
qq_face_49.gif 6KB
49.gif 6KB
qq_face_29.gif 6KB
29.gif 6KB
qq_face_97.gif 5KB
97.gif 5KB
qq_face_65.gif 5KB
65.gif 5KB
qq_face_31.gif 5KB
31.gif 5KB
qq_face_46.gif 5KB
46.gif 5KB
qq_face_57.gif 5KB
57.gif 5KB
qq_face_45.gif 5KB
45.gif 5KB
qq_face_8.gif 5KB
8.gif 5KB
qq_face_5.gif 5KB
qq_face_43.gif 4KB
43.gif 4KB
qq_face_33.gif 4KB
33.gif 4KB
qq_face_68.gif 4KB
68.gif 4KB
qq_face_26.gif 4KB
26.gif 4KB
qq_face_14.gif 4KB
14.gif 4KB
qq_face_7.gif 4KB
7.gif 4KB
kf-bottom.gif 4KB
qq_face_51.gif 4KB
51.gif 4KB
qq_face_10.gif 4KB
10.gif 4KB
qq_face_47.gif 4KB
47.gif 4KB
qq_face_72.gif 4KB
72.gif 4KB
qq_face_6.gif 3KB
共 1199 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
毕业_设计
- 粉丝: 1947
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Tableau实训一-教育网站指标评估
- 基于Python爬虫+词云图+情感分析对某东上完美日记的用户评论分析(数据集+代码).rar
- 古诗105-听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴听琴
- 一个普通的SpringCloud样例
- PSE-PCN考试题库该题库答案为真实选项,另外选项为额外插入,非原题选项
- 数据挖掘实战-基于KMeans算法对超市客户进行聚类分群(数据集+代码).rar
- css网页设计.pdf
- 数据分析案例-顾客购物数据可视化分析(数据集+代码).rar
- 19613fc3f7378acf2787f12bbf7a34a1.JPG
- mmexport1718846385059.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功