不小心便學會了電腦
Learning Computing without effort
Home
About
Jan
10
Add months, days, years to PHP date()
admin
programming
,
Web
2012-01-10
$date =
date
(“Y-m-d”);
$date =
strtotime
(
date
(“Y-m-d”,
strtotime
($date)) . ” +12 month”);
$date =
date
(“Y-m-d”,$date);
echo
$date;
Other examples
$date =
strtotime
(
date
(“Y-m-d”,
strtotime
($date)) . ” +1 day”);
$date =
strtotime
(
date
(“Y-m-d”,
strtotime
($date)) . ” +1 week”);
$date =
strtotime
(
date
(“Y-m-d”,
strtotime
($date)) . ” +2 week”);
$date =
strtotime
(
date
(“Y-m-d”,
strtotime
($date)) . ” +1 month”);
$date =
strtotime
(
date
(“Y-m-d”,
strtotime
($date)) . ” +30 days”);
Address:
http://kinghei.com/2012/01/10/add-months-days-years-to-php-date/
«
Tera Term display chinese
Javascript input number only or text/number only
»
Trackback
no comment
untill now
Add your comment now
Name
Email (Will NOT be published)
URL
Recent Posts
TCPDUMP 用法
ubuntu login as root
mysql reset root password
Cacti: gauge、counter、derive、absolute
openssl generate key and certificate
Sponsor
Who's Online
0 Members.
4 Guests.
Tags
Apple
asus
boot
bootable
c
cd
code block
command
date
dvd
eeepad
error
if else
iPhone
javascript
jquery
language
lib
live
mysql
netbook
Oregon settler
patch
pc games
perl
php
Prime
problem
programming
regex
regular expressions
shell
shorthand
solution
space
ssh
syntax
Tegra 3
The Oregon Trail: American Settler
Tools
transformer 2
usb
web
win7
wxWidgets
no comment untill now