国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

目錄 搜尋
Array Array Helper Benchmarking Benchmarking Class Caching Caching Driver Calendaring Calendaring Class CAPTCHA CAPTCHA Helper Config Config Class Cookie Cookie Helper Database Connecting to your Database Custom Function Calls Database Caching Class Database Configuration Database Forge Class Database Metadata Database Quick Start: Example Code Database Reference Database Utility Class DB Driver Reference Generating Query Results Queries Query Builder Class Query Helper Methods Transactions Date Date Helper Directory Directory Helper Download Download Helper Email Email Class Email Helper Encrypt Encrypt Class Encryption Encryption Library File File Helper File Uploading File Uploading Class Form Form Helper Form Validation Form Validation FTP FTP Class Functions compatibility_functions common_functions HTML HTML Helper HTML Table HTML Table Class Image Manipulation Image Manipulation Class Inflector Inflector Helper Input Input Class Javascript Javascript Class Language Language Class Language Helper Loader Loader Class Migrations Migrations Class Number Number Helper Output Output Class Pagination Pagination Class Path Path Helper Security Security Class Security Helper Session Session Library Shopping Cart Shopping Cart Class Smiley Smiley Helper String String Helper Template Parser Template Parser Class Text Text Helper Trackback Trackback Class Typography Typography Class Typography Helper Unit Testing Unit Testing Class URI URL User Agent XML XML-RPC and XML-RPC Server Zip Encoding Zip Encoding Class XML-RPC and XML-RPC Server Classes XML Helper User Agent Class URL Helper URI Class
文字

Date Helper文件包含幫助您處理日期的函數(shù)。

  • 加載此助手

  • 可用職能

  • 時(shí)區(qū)參考

加載此助手

使用以下代碼加載此助手:

$this->load->helper('date');

可用職能

現(xiàn)有下列職能:

now([$timezone = NULL])

參數(shù):

$ timezone(字符串) - 時(shí)區(qū)

返回:

UNIX時(shí)間戳

返回類型:

INT

  • $ timezonestring) - 時(shí)區(qū)返回:UNIX時(shí)間戳返回類型:int根據(jù)您的配置文件中的“時(shí)間參考”設(shè)置,將當(dāng)前時(shí)間作為UNIX時(shí)間戳返回,根據(jù)服務(wù)器本地時(shí)間或任何PHP支持的時(shí)區(qū)。如果您不打算將您的主時(shí)間參考設(shè)置為任何其他PHP支持的時(shí)區(qū)(如果您運(yùn)行的網(wǎng)站允許每個(gè)用戶設(shè)置自己的時(shí)區(qū)設(shè)置,您通常會(huì)這樣做),但使用PHP time()函數(shù)的此功能沒有任何好處?,F(xiàn)在回聲('澳大利亞/維多利亞'); 如果未提供時(shí)區(qū),它將time()根據(jù)time_reference設(shè)置返回。mdate([$datestr = ''[, $time = '']])參數(shù):$ datestr(string) - 日期字符串$ time(int) -  UNIX timestampReturns:MySQL格式的dateReturn類型:string

  • $ datestr字符串) - 日期字符串

  • $ timeint) -  UNIX時(shí)間戳

返回:MySQL格式的日期
返回類型:字符串
該函數(shù)與PHP的[date()](https://php.net/manual/en/function.date.php)函數(shù)相同,不同的是它允許使用MySQL風(fēng)格日期代碼,其中每個(gè)代碼字母都以百分號(hào),例如`%Y%m%d`

以這種方式進(jìn)行日期的好處是,您不必?fù)?dān)心會(huì)轉(zhuǎn)義任何不是日期代碼的字符,因?yàn)槟ǔP枰幚碓?code>date()函數(shù)。

例子:

$ datestring ='年:%Y月:%m日:%d  - %h:%i%a'; $ time = time(); 回聲mdate($日期字符串,$時(shí)間);

如果時(shí)間戳未包含在第二個(gè)參數(shù)中,則將使用當(dāng)前時(shí)間。

standard_date([$fmt = 'DATE_RFC822'[, $time = NULL]])

參數(shù):

$ fmt(字符串) - 日期格式$ time(int) -  UNIX時(shí)間戳

返回:

格式化日期或FALSE格式無效

返回類型:

  • $ fmt字符串) - 日期格式

  • $ timeint) -  UNIX時(shí)間戳

Returns:  Formatted date or FALSE on invalid format
Return type:  string
Lets you generate a date string in one of several standardized formats.

例子:

$ format ='DATE_RFC822'; $ time = time(); echo standard_date($ format,$ time);

這一功能已被廢棄。使用本機(jī)date()結(jié)合日期時(shí)間格式常數(shù)相反:

回聲日期(DATE_RFC822,time());

支持格式:

Constant Description Example    DATE\_ATOM Atom 2005-08-15T16:13:03+0000   DATE\_COOKIE HTTP Cookies Sun, 14 Aug 2005 16:13:03 UTC   DATE\_ISO8601 ISO-8601 2005-08-14T16:13:03+00:00   DATE\_RFC822 RFC 822 Sun, 14 Aug 05 16:13:03 UTC   DATE\_RFC850 RFC 850 Sunday, 14-Aug-05 16:13:03 UTC   DATE\_RFC1036 RFC 1036 Sunday, 14-Aug-05 16:13:03 UTC   DATE\_RFC1123 RFC 1123 Sun, 14 Aug 2005 16:13:03 UTC   DATE\_RFC2822 RFC 2822 Sun, 14 Aug 2005 16:13:03 +0000   DATE\_RSS RSS Sun, 14 Aug 2005 16:13:03 UTC   DATE\_W3C W3C 2005-08-14T16:13:03+0000

local_to_gmt([$time = ''])

參數(shù):

$ time(int) -  UNIX時(shí)間戳

返回:

UNIX時(shí)間戳

返回類型:

INT

  • $ timeint) -  UNIX時(shí)間戳記返回:UNIX時(shí)間戳記返回類型:int將UNIX時(shí)間戳記作為輸入并將其作為GMT返回。例如:$ gmt = local_to_gmt(time()); gmt_to_local([$time = ''[, $timezone = 'UTC'[, $dst = FALSE]]])參數(shù):$ time(int) -  UNIX時(shí)間戳$ timezone(字符串) - 時(shí)區(qū)$ dst(bool) -  DST是否為activeReturns:UNIX timestamp返回類型:int

  • $ timeint) -  UNIX時(shí)間戳

  • $ timezone字符串) - 時(shí)區(qū)

  • $ dstbool) -  DST是否處于活動(dòng)狀態(tài)

Returns:  UNIX timestamp
Return type:  int
Takes a UNIX timestamp (referenced to GMT) as input, and converts it to a localized timestamp based on the timezone and Daylight Saving Time submitted.

例子:

$ timestamp = 1140153693; $ timezone ='UM8'; $ daylight_saving = TRUE; echo gmt_to_local($ timestamp,$ timezone,$ daylight_saving);

有關(guān)時(shí)區(qū)的列表,請參閱本頁底部的引用。

mysql_to_unix([$time = ''])

參數(shù):

$ time(string) -  MySQL時(shí)間戳

返回:

UNIX時(shí)間戳

返回類型:

INT

  • $ timestring) -  MySQL時(shí)間戳記返回:UNIX時(shí)間戳記返回類型:int將MySQL時(shí)間戳記作為輸入并將其作為UNIX時(shí)間戳記返回。例如:$ unix = mysql_to_unix('20061124092345'); unix_to_human([$time = ''[, $seconds = FALSE[, $fmt = 'us']]])參數(shù):$ time(int) -  UNIX時(shí)間戳$ seconds(bool) - 是否顯示秒數(shù)$ fmt(string) -  format(us或euro)返回:格式化dateReturn類型:string

  • $ timeint) -  UNIX時(shí)間戳

  • $秒布爾) - 是否顯示秒

  • $ fmt字符串) - 格式(美元或歐元)

Returns:  Formatted date
Return type:  string
Takes a UNIX timestamp as input and returns it in a human readable format with this prototype:

YYYYY-MM-DD HH:mm:SS AM/PM

如果您需要在表單字段中顯示日期以供提交,這可能非常有用。

時(shí)間可以用秒來格式化,也可以設(shè)置為歐洲或美國格式。如果只提交時(shí)間戳,它將在沒有秒的情況下返回美國格式的時(shí)間。

例子:

$ now = time(); echo unix_to_human($ now); // US time,no seconds echo unix_to_human($ now,TRUE,'us'); //美國時(shí)間秒鐘回顯unix_to_human($ now,TRUE,'eu'); //秒數(shù)的歐元時(shí)間

human_to_unix([$datestr = ''])

參數(shù):

$ datestr(int) - 日期字符串

返回:

UNIX時(shí)間戳或FALSE失敗

返回類型:

INT

  • $ datestrint) - 日期字符串返回:UNIX時(shí)間戳或失敗時(shí)的FALSE返回類型:int與unix_to_time()函數(shù)相反。將“人類”時(shí)間作為輸入并將其作為UNIX時(shí)間戳返回。如果您接受通過表單提交的“人”格式的日期,這很有用。返回布爾型傳遞給它的FALSE日期字符串沒有按照上面的說明格式化。例如:$ now = time(); $ human = unix_to_human($ now); $ unix = human_to_unix($ human); nice_date([$bad_date = ''[, $format = FALSE]])參數(shù):$ bad_date(int) - 非常格式化的類日期字符串$ format(string) - 要返回的日期格式(與PHP的date()函數(shù)相同)返回:格式化dateReturn類型:string

  • $ bad_dateint) - 非常格式化的類似日期的字符串

  • $ formatstring) - 返回的日期格式(與PHP date()函數(shù)相同)

Returns:  Formatted date
Return type:  string
This function can take a number poorly-formed date formats and convert them into something useful. It also accepts well-formed dates.

該函數(shù)默認(rèn)返回一個(gè)UNIX時(shí)間戳。您可以選擇傳遞格式字符串(與PHP date()函數(shù)接受的類型相同)作為第二個(gè)參數(shù)。

例子:

$ bad_date ='199605'; //產(chǎn)生:1996-05-01 $ better_date = nice_date($ bad_date,'Ym-d'); $ bad_date ='9-11-2001'; //產(chǎn)生:2001-09-11 $ better_date = nice_date($ bad_date,'Ym-d');

這個(gè)函數(shù)被廢棄了。日期時(shí)間類相反。

timespan([$seconds = 1[, $time = ''[, $units = '']]])

參數(shù):

$ seconds(int) - 秒數(shù)$ time(字符串) -  UNIX時(shí)間戳$ units(int) - 要顯示的時(shí)間單位數(shù)

返回:

格式化時(shí)差

返回類型:

  • $ secondsint) - 秒數(shù)

  • $ time字符串) -  UNIX時(shí)間戳

  • $ unitsint) - 要顯示的時(shí)間單位數(shù)

Returns:  Formatted time difference
Return type:  string
Formats a UNIX timestamp so that is appears similar to this:

1年10個(gè)月2周5天10小時(shí)16分鐘

第一個(gè)參數(shù)必須包含UNIX時(shí)間戳。第二個(gè)參數(shù)必須包含比第一個(gè)時(shí)間戳更大的時(shí)間戳。第三個(gè)參數(shù)是可選的,并限制顯示時(shí)間單位的數(shù)量。

如果第二個(gè)參數(shù)為空,則將使用當(dāng)前時(shí)間。

此函數(shù)最常見的目的是顯示從過去某個(gè)時(shí)間點(diǎn)到現(xiàn)在已經(jīng)過去了多長時(shí)間。

例子:

$ post_date ='1079621429'; $ now = time(); $ units = 2; 回聲時(shí)間范圍($ post_date,$ now,$ units);

此函數(shù)生成的文本位于以下語言文件中:language/<your_lang>/date_lang.php

days_in_month([$month = 0[, $year = '']])

參數(shù):

$ month(int) - 數(shù)字月份$ year(int) - 數(shù)字年份

返回:

指定月份中的天數(shù)

返回類型:

INT

  • $ monthint) - 數(shù)字月份

  • $ yearint) - 一個(gè)數(shù)字年份

Returns:  Count of days in the specified month
Return type:  int
Returns the number of days in a given month/year. Takes leap years into account.

例子:

echo days_in_month(06,2005);

如果第二個(gè)參數(shù)為空,則將使用當(dāng)前年份。

此函數(shù)將別名本機(jī)cal_days_in_month(),如果可以的話。

date_range([$unix_start = ''[, $mixed = ''[, $is_unix = TRUE[, $format = 'Y-m-d']]]])

參數(shù):

$ unix_start(int) - 范圍開始日期的UNIX時(shí)間戳$ mixed(int) - 范圍結(jié)束日期或時(shí)間間隔的UNIX時(shí)間戳(以天為單位)$ is_unix(bool) - 如果$ mixed不是時(shí)間戳記,則設(shè)置為FALSE $ format ) - 輸出日期格式與日期()中的相同

返回:

一組日期

返回類型:

排列

  • $ unix_startint) - 范圍開始日期的UNIX時(shí)間戳

  • $ mixedint) - 范圍結(jié)束日期或間隔的UNIX時(shí)間戳,以天為單位

  • $ is_unixbool) - 如果$ mixed不是時(shí)間戳,則設(shè)置為FALSE

  • $ formatstring) - 輸出日期格式,與in相同date()

Returns:  An array of dates
Return type:  array
Returns a list of dates within a specified period.

例子:

$ range = date_range('2012-01-01','2012-01-15'); 回聲“2012年前15天:”; foreach($ range as $ date){echo $ date。“\ n”; }

timezones([$tz = ''])

參數(shù):

$ tz(字符串) - 一個(gè)數(shù)字時(shí)區(qū)

返回:

與UTC的小時(shí)差異

返回類型:

INT

  • $ tzstring) - 數(shù)字時(shí)區(qū)返回:與UTC的小時(shí)差值返回類型:int獲取時(shí)區(qū)參考(有效時(shí)區(qū)列表,請參見下面的“時(shí)區(qū)參考”),并返回與UTC時(shí)差的小時(shí)數(shù)。例如:回聲時(shí)區(qū)('UM5'); 使用此功能時(shí)非常有用timezone_menu()timezone_menu([$default = 'UTC'[, $class = ''[, $name = 'timezones'[, $attributes = '']]]])參數(shù):$ default(string) -  Timezone $ class(string) - 類名稱$ name(string) - 菜單名稱$ attributes(mixed) -  HTML屬性返回:帶時(shí)區(qū)的HTML下拉菜單返回類型:字符串

  • $ defaultstring) - 時(shí)區(qū)

  • $ classstring) - 類名

  • $ name字符串) - 菜單名稱

  • $ attributesmixed) -  HTML屬性

Returns:  HTML drop down menu with time zones
Return type:  string
Generates a pull-down menu of timezones, like this one:

(UTC -12:00)貝克/豪蘭島(UTC -11:00)紐埃島薩摩亞時(shí)區(qū)(UTC -10:00)塔希提島庫克群島夏威夷阿留申標(biāo)準(zhǔn)時(shí)間(UTC -9:30)馬克薩斯群島UTC -9:00)阿拉斯加標(biāo)準(zhǔn)時(shí)間,甘比爾群島(UTC -8:00)太平洋標(biāo)準(zhǔn)時(shí)間,克利珀頓島(UTC -7:00)山區(qū)標(biāo)準(zhǔn)時(shí)間(UTC -6:00)中部標(biāo)準(zhǔn)時(shí)間(UTC -5: 00)東部標(biāo)準(zhǔn)時(shí)間,西加勒比海標(biāo)準(zhǔn)時(shí)間(UTC -4:30)委內(nèi)瑞拉標(biāo)準(zhǔn)時(shí)間(UTC -4:00)大西洋標(biāo)準(zhǔn)時(shí)間,東加勒比標(biāo)準(zhǔn)時(shí)間(UTC -3:30)紐芬蘭標(biāo)準(zhǔn)時(shí)間(UTC -3: 00)阿根廷,巴西,法屬圭亞那,烏拉圭(UTC -2:00)南佐治亞/南桑威奇群島(UTC -1:00)亞速爾群島,佛得角群島(UTC)格林尼治標(biāo)準(zhǔn)時(shí)間,西歐時(shí)間(UTC +1: 00)中歐時(shí)間,西非時(shí)間(UTC +2:00)中非時(shí)間,東歐時(shí)間,加里寧格勒時(shí)間(UTC +3:00)莫斯科時(shí)間,東非時(shí)間(UTC +3:30)伊朗標(biāo)準(zhǔn)時(shí)間(UTC +4:00)阿塞拜疆標(biāo)準(zhǔn)時(shí)間,薩馬拉時(shí)間(UTC +4:30)阿富汗(UTC +5孟加拉國標(biāo)準(zhǔn)時(shí)間,葉卡捷琳堡時(shí)間(UTC +5:30)印度標(biāo)準(zhǔn)時(shí)間,斯里蘭卡時(shí)間(UTC +5:45)尼泊爾時(shí)間(UTC +6:00)孟加拉國標(biāo)準(zhǔn)時(shí)間,不丹時(shí)間,鄂木斯克時(shí)間(UTC +6:30)科科斯群島,緬甸(UTC +7:00)克拉斯諾亞爾斯克時(shí)間,柬埔寨,老撾,泰國,越南(UTC +8:00)澳大利亞西部標(biāo)準(zhǔn)時(shí)間,北京時(shí)間,伊爾庫茨克時(shí)間(UTC +8:45)澳大利亞中部標(biāo)準(zhǔn)時(shí)間(UTC +9:00)日本標(biāo)準(zhǔn)時(shí)間,韓國標(biāo)準(zhǔn)時(shí)間,雅庫茨克時(shí)間(UTC +9:30)澳大利亞中部標(biāo)準(zhǔn)時(shí)間(UTC +10:00)澳大利亞東部標(biāo)準(zhǔn)時(shí)間,符拉迪沃斯托克時(shí)間(UTC + 10:30)豪勛爵島(UTC +11:00)Srednekolymsk時(shí)間,所羅門群島,瓦努阿圖(UTC +11:30)諾??藣u(UTC +12:00)斐濟(jì),吉爾伯特群島,堪察加時(shí)間,新西蘭標(biāo)準(zhǔn)時(shí)間(UTC +12:45)查塔姆群島標(biāo)準(zhǔn)時(shí)間(UTC +13:00)鳳凰城時(shí)間,湯加(UTC +14 :00)Line Islands如果您運(yùn)行允許用戶設(shè)置其本地時(shí)區(qū)值的成員資格網(wǎng)站,則此菜單很有用。

第一個(gè)參數(shù)允許您設(shè)置菜單的“選定”狀態(tài)。例如,要將太平洋時(shí)間設(shè)置為默認(rèn)設(shè)置,您將執(zhí)行以下操作:

echo timezone_menu('UM8');

請參閱下面的時(shí)區(qū)引用,以查看此菜單的值。

第二個(gè)參數(shù)允許您為菜單設(shè)置CSS類名。

第四個(gè)參數(shù)允許您在生成的SELECT標(biāo)記上設(shè)置一個(gè)或多個(gè)屬性。

菜單中包含的文本位于以下語言文件中:language/<your_lang>/date_lang.php

時(shí)區(qū)參考

下表指出每個(gè)時(shí)區(qū)及其位置。

注意,為了清晰和格式化,一些位置列表已經(jīng)被刪減。

時(shí)區(qū)

位置

UM12

(UTC  -  12:00)貝克/豪蘭島

UM11

(UTC  -  11:00)紐埃薩摩亞時(shí)區(qū)

M10

(UTC  -  10:00)庫克群島夏威夷阿留申標(biāo)準(zhǔn)時(shí)間

UM95

(UTC  -  09:30)馬克薩斯群島

UM9

(UTC  -  09:00)阿拉斯加標(biāo)準(zhǔn)時(shí)間,甘比爾群島

UM8

(UTC  -  08:00)太平洋標(biāo)準(zhǔn)時(shí)間,克利珀頓島

UM7

(UTC  -  07:00)標(biāo)準(zhǔn)時(shí)間

UM6

(UTC  -  06:00)中部標(biāo)準(zhǔn)時(shí)間

UM5

(UTC  -  05:00)西加勒比海東部標(biāo)準(zhǔn)時(shí)間

UM45

(UTC  -  04:30)委內(nèi)瑞拉標(biāo)準(zhǔn)時(shí)間

UM4

(UTC  -  04:00)大西洋標(biāo)準(zhǔn)時(shí)間,東加勒比地區(qū)

UM35

(UTC  -  03:30)紐芬蘭標(biāo)準(zhǔn)時(shí)間

UM3

(UTC  -  03:00)阿根廷,巴西,法屬圭亞那,烏拉圭

UM2

(UTC  -  02:00)南喬治亞/南桑威奇群島

UM1

(UTC -1:00)佛得角群島亞速爾群島

世界標(biāo)準(zhǔn)時(shí)間

(UTC)格林尼治標(biāo)準(zhǔn)時(shí)間,西歐時(shí)間

UP1

(UTC +1:00)中歐時(shí)間,西非時(shí)間

UP2

(UTC +2:00)中部非洲時(shí)間,東歐時(shí)間

UP3

(UTC +3:00)莫斯科時(shí)間,東非時(shí)間

UP35

(UTC +3:30)伊朗標(biāo)準(zhǔn)時(shí)間

UP4

(UTC +4:00)阿塞拜疆標(biāo)準(zhǔn)時(shí)間,薩馬拉時(shí)間

UP45

(UTC +4:30)阿富汗

UP5

(UTC +5:00)巴基斯坦標(biāo)準(zhǔn)時(shí)間,葉卡捷琳堡時(shí)間

UP55

(UTC +5:30)印度標(biāo)準(zhǔn)時(shí)間,斯里蘭卡時(shí)間

UP575

(UTC +5:45)尼泊爾時(shí)間

UP6

(UTC +6:00)孟加拉國標(biāo)準(zhǔn)時(shí)間,不丹時(shí)間,鄂木斯克時(shí)間

UP65

(UTC +6:30)緬甸科科斯群島

UP7

(UTC +7:00)克拉斯諾亞爾斯克時(shí)間,柬埔寨,老撾,泰國,越南

UP8

(UTC +8:00)澳大利亞西部標(biāo)準(zhǔn)時(shí)間,北京時(shí)間

UP875

(UTC +8:45)澳大利亞中西部標(biāo)準(zhǔn)時(shí)間

UP9

(UTC +9:00)日本標(biāo)準(zhǔn)時(shí)間,韓國標(biāo)準(zhǔn)時(shí)間,雅庫茨克

UP95

(UTC +9:30)澳大利亞中部標(biāo)準(zhǔn)時(shí)間

UP10

(UTC +10:00)澳大利亞東部標(biāo)準(zhǔn)時(shí)間,符拉迪沃斯托克時(shí)間

UP105

(UTC +10:30)豪勛爵島

UP11

(UTC +11:00)中科雷姆斯克時(shí)間,所羅門群島,瓦努阿圖

UP115

(UTC +11:30)諾福克島

UP12

(UTC +12:00)斐濟(jì),吉爾伯特群島,新西蘭堪察加

UP1275

(UTC +12:45)查塔姆群島標(biāo)準(zhǔn)時(shí)間

UP13

(UTC +13:00)鳳凰島時(shí)間,湯加

UP14

(UTC +14:00)線路島

上一篇: 下一篇: