<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SukmoonLee Blog &#187; strtotime</title>
	<atom:link href="http://blog.sukmoonlee.com/wordpress/archives/tag/strtotime/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.sukmoonlee.com/wordpress</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Thu, 20 Sep 2012 00:01:14 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>php에서 time 처리</title>
		<link>http://blog.sukmoonlee.com/wordpress/archives/250</link>
		<comments>http://blog.sukmoonlee.com/wordpress/archives/250#comments</comments>
		<pubDate>Tue, 04 Sep 2012 11:55:35 +0000</pubDate>
		<dc:creator>Sukmoon Lee</dc:creator>
				<category><![CDATA[Program]]></category>
		<category><![CDATA[strtotime]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://blog.sukmoonlee.com/wordpress/?p=250</guid>
		<description><![CDATA[php에서 time() 을 호출하게 되면 unix timestamp를 반환하게 된다. 해당 값은 단위가 초이기 때문에 간단한 수칙연산으로 날짜를 변경이 가능하다. 하지만, 현재 시간에서 1달을 더하거나 할때에는 생각할 부분이 많다. 30 혹은 31일인 경우까지 고려를 해야 하며, 1년을 더 할 경우에는 윤년 계산까지 해야 한다. 이럴때 아래의 strtotime() 를 사용하면 보다 간편하게 계산이 가능하다. &#160; &#60;?php echo <a href='http://blog.sukmoonlee.com/wordpress/archives/250' class='excerpt-more'>[...]</a>]]></description>
				<content:encoded><![CDATA[<p>php에서 time() 을 호출하게 되면 unix timestamp를 반환하게 된다. 해당 값은 단위가 초이기 때문에 간단한 수칙연산으로 날짜를 변경이 가능하다.</p>
<p>하지만, 현재 시간에서 1달을 더하거나 할때에는 생각할 부분이 많다. 30 혹은 31일인 경우까지 고려를 해야 하며, 1년을 더 할 경우에는 윤년 계산까지 해야 한다.</p>
<p>이럴때 아래의 strtotime() 를 사용하면 보다 간편하게 계산이 가능하다.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;now&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;10 September 2000&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;+1 day&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;+1 week&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;+1 week 2 days 4 hours 2 seconds&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;next Thursday&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;last Monday&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>참고 URL: <a href="http://www.php.net/manual/en/function.strtotime.php">http://www.php.net/manual/en/function.strtotime.php</a><br />
참고 URL: <a href="http://www.php.net/manual/en/function.time.php">http://www.php.net/manual/en/function.time.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sukmoonlee.com/wordpress/archives/250/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
