The interrotation of time stamp function and time in PHP

time:11-02-10 forum:PHP tools and code
  Time stamp format
[code]$year= ((int) substr (.Quot; 2008-12-04.quot; 0,4)); / / / / acquired

$month= (int) substr. H, $day, $year)..quot;.Lt; br.gt;.Quot; [/code]


[code]echo date. "2009-1-22")
examples are as follows:
[code]echo strtotime ("2009-1-22"); [/code]
results: 1232553600
Description: return to January 22, 2009 0 points, 0 minutes, 0 seconds,

two, PHP time stamp function to obtain English text date time example:
easy to compare, use when the time will be the time Stamp and specified timestamp conversion into system time

(1) print tomorrow's timestamp strtotime ("1 day")

current time: [code]echo date ("Y-m-d H:i:s", time ()); [/code]
results: 1 Ay))); [/code]
results: 2009-01-23 09:40:25

(2) print yesterday's timestamp strtotime ("-1 day")

the current time: [code]echo date ( ("-1 day")); [/code] results: 2009-01-21 09:40:25

(3) print the time stamp of the next week at the time stamp strtotime ("1 week")

the present time: echo date. Result: 2009-01-29 09:40:25

(4) print the time stamp of the last week at strtotime ("-1 week")

the current time: [code]echo date ("Y-m-d H:i:s"). [/code]
results: 2009-01-15 09:40:25

(5) print the timestamp of the next week, strtotime ("next Thursday")

the current time: [code]echo date. Rtotime ("next Thursday")); [/code]
results: 2009-01-29 00:00:00

(6) print the timestamp of last week's timestamp strtotime ("last Thursday")
E ("Y-m-d H:i:s", strtotime ("last Thursday")) results: the 2009-01-15 00:00:00

PHP timestamp function example shows that strtotime can parse the date and time description of any English text as a Unix timestamp. The date of the date.

prev:HTML next:Ji'nan starts "spring breeze action" mor...
post comment
Notice



approved   What is the living condition of the ...   The family photo played by their par...   The universal Handbook of life in Ji...   Dr. doctorate: two hands earn money ...   Visiting group of pregnant women wit...
rand   Using JSON to implement cross domain...   PHP good verification code   PHP upload file code, suitable for b...   Install.php simple production   The use of UBB in PHP
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com