{"id":7138,"date":"2024-10-23T14:05:00","date_gmt":"2024-10-23T14:05:00","guid":{"rendered":"https:\/\/withcode.tech\/media\/?p=7138"},"modified":"2026-01-05T13:48:42","modified_gmt":"2026-01-05T13:48:42","slug":"php_date","status":"publish","type":"post","link":"https:\/\/withcode.tech\/media\/php_date\/","title":{"rendered":"PHP\u306e\u65e5\u4ed8\u53d6\u5f97\u65b9\u6cd5\u3092\u30de\u30b9\u30bf\u30fc\uff01\u30b3\u30fc\u30c9\u4f8b\u3067\u5b66\u3076\u65e5\u4ed8\u306e\u53d6\u5f97\u3068\u6d3b\u7528\u65b9\u6cd5\u3068\u5b9f\u8df5\u4f8b\u307e\u3067\u8a73\u3057\u304f\u89e3\u8aac"},"content":{"rendered":"<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-14.40.37.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u751f\u5f92<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u30da\u30f3\u535a\u58eb\uff01PHP\u3067\u65e5\u4ed8\u3092\u53d6\u5f97\u3057\u305f\u3044\u3093\u3067\u3059\u3051\u3069\u3001\u3069\u3046\u3084\u3063\u3066\u66f8\u3051\u3070\u3044\u3044\u306e\u304b\u5168\u7136\u308f\u304b\u3089\u306a\u304f\u3066\u2026<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-right\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-15.08.37.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u30da\u30f3\u535a\u58eb<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u3088\u3044\u8cea\u554f\u3058\u3083\uff01\u65e5\u4ed8\u306e\u53d6\u5f97\u306fPHP\u306e\u57fa\u672c\u3058\u3083\u304c\u3001\u5965\u304c\u6df1\u304f\u3066\u975e\u5e38\u306b\u4fbf\u5229\u306a\u6a5f\u80fd\u3067\u3082\u3042\u308b\u3002\u3057\u3063\u304b\u308a\u5b66\u3093\u3067\u3044\u3053\u3046\u305e\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-14.48.08.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u751f\u5f92<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u306f\u3044\uff01\u304a\u9858\u3044\u3057\u307e\u3059\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<p>PHP\u3092\u4f7f\u3063\u3066\u65e5\u4ed8\u3084\u6642\u9593\u3092\u64cd\u4f5c\u3057\u305f\u3044\u3051\u308c\u3069\u3001\u3069\u3053\u304b\u3089\u59cb\u3081\u308c\u3070\u3044\u3044\u304b\u308f\u304b\u3089\u306a\u3044\u3068\u611f\u3058\u3066\u3044\u307e\u305b\u3093\u304b\uff1f<\/p>\n\n\n\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001PHP\u306e\u57fa\u672c\u95a2\u6570\u3067\u3042\u308bdate\u95a2\u6570\u304b\u3089\u3001\u67d4\u8edf\u306a\u65e5\u4ed8\u64cd\u4f5c\u304c\u53ef\u80fd\u306aDateTime\u30af\u30e9\u30b9\u306e\u4f7f\u3044\u65b9\u307e\u3067\u3001\u5177\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3092\u901a\u3058\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u65e5\u4ed8\u306e\u53d6\u5f97\u3084\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306e\u8a2d\u5b9a\u3001\u3055\u3089\u306b\u5b9f\u8df5\u7684\u306a\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u307e\u3067\u3001PHP\u3067\u306e\u65e5\u4ed8\u64cd\u4f5c\u3092\u30de\u30b9\u30bf\u30fc\u3057\u307e\u3057\u3087\u3046\uff01<\/p>\n\n\n\n<p>PHP\u306e\u516c\u5f0f\u60c5\u5831\u306f\u4ee5\u4e0b\u304b\u3089\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/www.php.net\/manual\/ja\/index.php\">PHP\u30de\u30cb\u30e5\u30a2\u30eb<\/a><\/p>\n\n\n\n<p class=\"is-style-icon_announce\">\u300c\u5b66\u7fd2\u2192\u6848\u4ef6\u7372\u5f97\u300d\u306b\u3064\u306a\u3052\u305f\u53d7\u8b1b\u751f\u306e\u30ea\u30a2\u30eb\u306a\u4f53\u9a13\u8ac7\u3082\u516c\u958b\u4e2d\uff01<br>\u50cd\u304d\u65b9\u3092\u5909\u3048\u305f\u3044\u65b9\u306b\u3082\u97ff\u304f\u30b9\u30c8\u30fc\u30ea\u30fc\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"is-style-icon_info\"><strong><strong>\u83c5\u4e95<\/strong>\u3055\u3093<\/strong><br>\u5c06\u6765\u7684\u3078\u306e\u4e0d\u5b89\u3068\u5b50\u80b2\u3066\u3068\u3044\u3046\u80cc\u666f\u304b\u3089\u300c\u526f\u696d\u300d\u306b\u6311\u6226\u3057\u3088\u3046\u3068\u6c7a\u610f\u3002\u72ec\u5b66\u304b\u3089\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u5b66\u7fd2\u3092\u958b\u59cb\u3057\u3066\u3044\u305f\u304c\u3001WithCode\u306b\u51fa\u4f1a\u3044\u4f53\u9a13\u30b3\u30fc\u30b9\u3092\u53d7\u8b1b\u3002\u7d044\u30f6\u6708\u306e\u5b66\u7fd2\u306b\u53d6\u308a\u7d44\u307f\u3001\u5f53\u521d\u306e\u76ee\u6a19\u3067\u3042\u3063\u305f\u5352\u696d\u30c6\u30b9\u30c8\u5408\u683c\u3092\u5b9f\u73fe\u3057\u305f\u3002WithCode Platinum\u306b\u30663\u4ef6\u306e\u6848\u4ef6\u3092\u62c5\u5f53\u3057\u3001\u73fe\u5728\u306f\u526f\u696d\u3060\u3051\u3067\u306a\u304f\u672c\u683c\u7684\u306b\u300c\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u300d\u3068\u3057\u3066\u5728\u5b85\u3067\u6d3b\u8e8d\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u8003\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u8a73\u3057\u304f\u306f<a href=\"https:\/\/withcode.tech\/media\/interview_5\/\" title=\"\">\u3053\u3061\u3089\u306e\u8a18\u4e8b<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2024\/02\/\u30a4\u30f3\u30bf\u30d3\u30e5\u30fc-6-1-300x169.png\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/withcode.tech\/media\/interview_5\/\">\u3010\u5b50\u80b2\u3066\u30de\u30de\u3055\u3093\u5fc5\u898b\u3011\u300c\u5728\u5b85\u00d7\u526f\u696d\u300d\u3092\u9054\u6210\uff01\u591a\u65b9\u5411\u3067\u6d3b\u8e8d\u4e2d\u306e\u30de\u30de\u3055\u3093\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u306b\u30a4\u30f3\u30bf\u30d3\u30e5\u30fc\uff01<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">\u30da\u30f3\u535a\u58eb\u3001\u30de\u30de\u3055\u3093\u306a\u306e\u306b\u5728\u5b85\u3067\u526f\u696d\u3082\u3053\u306a\u3057\u3066\u3044\u308b\u65b9\u304c\u3044\u308b\u3063\u3066\u805e\u3044\u305f\u3093\u3067\u3059\u3051\u3069\u3001\u672c\u5f53\u3067\u3059\u304b\uff1f\u3060\u3068\u3057\u305f\u3089\u3059\u3054\u3059\u304e\u307e\u3059\uff01 \u3046\u3080\u3001\u3046\u3061\u306e\u53d7\u8b1b\u751f\u3067\u306a\u3001\u307e\u3055\u306b\u201c\u6642\u9593\u3082\u5834\u6240&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<p class=\"is-style-balloon_box2\"><strong><strong>\u83c5\u4e95<\/strong>\u3055\u3093\u306e\u4e3b\u306a\u5236\u4f5c\u5b9f\u7e3e\u306f\u3053\u3061\u3089<\/strong><\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -external\" data-type=\"type3\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u5e83\u544a\u7528\u9014\u3067\u306e\u65b0\u898fLP\u5236\u4f5c<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/07\/\u83c5\u4e95\u3055\u3093.webp\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/withcode.tech\/works\/yourdelt\/\" target=\"_blank\" rel=\"noopener noreferrer\">\u682a\u5f0f\u4f1a\u793eYOURDELT \u69d8<\/a>\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>PHP\u3067\u4eca\u65e5\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5<\/strong><\/h2>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30a2\u30bb\u30c3\u30c8-6@4x-2.png\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u30da\u30f3\u535a\u58eb<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u307e\u305a\u306f\u3001\u4eca\u65e5\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3059\u308b\u305e\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>date\u95a2\u6570\u3092\u4f7f\u3046<\/strong><\/h3>\n\n\n\n<p>\u3053\u306e\u95a2\u6570\u306f\u3001\u6307\u5b9a\u3055\u308c\u305f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5f93\u3063\u3066\u73fe\u5728\u306e\u65e5\u4ed8\u3084\u6642\u523b\u3092\u51fa\u529b\u3067\u304d\u308b\u4fbf\u5229\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u4eca\u65e5\u306e\u65e5\u4ed8\u3092\u300cYYYY-MM-DD\u300d\u3068\u3044\u3046\u5f62\u5f0f\u3067\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u3001\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>echo date(&quot;Y-m-d&quot;);<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u73fe\u5728\u306e\u5e74\u30fb\u6708\u30fb\u65e5\u304c\u300c2024-10-16\u300d\u306e\u3088\u3046\u306a\u5f62\u3067\u8868\u793a\u3055\u308c\u307e\u3059\u3002date\u95a2\u6570\u3067\u306f\u3001&#8221;Y&#8221;\u3067\u5e74\u3001&#8221;m&#8221;\u3067\u6708\u3001&#8221;d&#8221;\u3067\u65e5\u3092\u8868\u73fe\u3067\u304d\u3001\u3055\u307e\u3056\u307e\u306a\u5f62\u5f0f\u3067\u65e5\u4ed8\u3092\u8868\u793a\u3067\u304d\u308b\u306e\u3067\u899a\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u3055\u3089\u306b\u3001<strong><span class=\"swl-marker mark_yellow\">date\u95a2\u6570\u306f\u6642\u9593\u3082\u53d6\u5f97\u3067\u304d\u3001\u4f8b\u3048\u3070\u300cY-m-d H:i\u300d\u3068\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u5e74\u3001\u6708\u3001\u65e5\u3001\u6642\u3001\u5206\u3001\u79d2\u3092\u4e00\u62ec\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/span><\/strong>\u3053\u306e\u3088\u3046\u306b\u3001date\u95a2\u6570\u306f\u3001\u30b7\u30f3\u30d7\u30eb\u304b\u3064\u67d4\u8edf\u306b\u73fe\u5728\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3067\u304d\u308b\u306e\u3067\u975e\u5e38\u306b\u6709\u52b9\u306a\u65b9\u6cd5\u3068\u8a00\u3048\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>DateTime\u30af\u30e9\u30b9\u3092\u6d3b\u7528\u3057\u305f\u65e5\u4ed8\u64cd\u4f5c\u306e\u65b9\u6cd5<\/strong><\/h2>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30a2\u30bb\u30c3\u30c8-6@4x-2.png\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u30da\u30f3\u535a\u58eb<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u6b21\u306f\u3001DateTime\u30af\u30e9\u30b9\u3092\u6d3b\u7528\u3057\u305f\u65e5\u4ed8\u64cd\u4f5c\u306e\u65b9\u6cd5\u3092\u89e3\u8aac\u3059\u308b\u305e\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>DateTime\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3066\u4eca\u65e5\u306e\u65e5\u4ed8\u3092\u8868\u793a\u3059\u308b<\/strong><\/h3>\n\n\n\n<p>PHP\u3067\u4eca\u65e5\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u3082\u3046\u4e00\u3064\u306e\u4fbf\u5229\u306a\u65b9\u6cd5\u304cDateTime\u30af\u30e9\u30b9\u306e\u6d3b\u7528\u3067\u3059\u3002<strong><span class=\"swl-marker mark_yellow\">\u3053\u306e\u30af\u30e9\u30b9\u306f\u3001\u65e5\u4ed8\u3084\u6642\u9593\u3092\u3088\u308a\u8a73\u7d30\u306b\u6271\u3048\u308b<\/span><\/strong>\u305f\u3081\u3001\u67d4\u8edf\u306a\u65e5\u4ed8\u64cd\u4f5c\u304c\u53ef\u80fd\u3067\u3059\u3002\u73fe\u5728\u306e\u65e5\u4ed8\u3092\u8868\u793a\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u3088\u3046\u306bDateTime\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u3001\u305d\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3057\u3066\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>$date = new DateTime();\necho $date-&gt;format(&#39;Y-m-d&#39;);<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u307e\u305aDateTime\u3092\u4f7f\u7528\u3057\u3001\u305d\u306e\u5f8cformat\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u65e5\u4ed8\u3092\u300cYYYY-MM-DD\u300d\u306e\u5f62\u5f0f\u3067\u51fa\u529b\u3057\u307e\u3059\u3002DateTime\u30af\u30e9\u30b9\u306f\u3001\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u6307\u5b9a\u3084\u65e5\u6642\u306e\u8a08\u7b97\u3068\u3044\u3063\u305f\u8907\u96d1\u306a\u64cd\u4f5c\u3082\u53ef\u80fd\u3067\u3001\u3088\u308a\u9ad8\u5ea6\u306a\u65e5\u4ed8\u64cd\u4f5c\u3092\u884c\u3044\u305f\u3044\u5834\u9762\u3067\u6709\u52b9\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001DateTime\u30af\u30e9\u30b9\u306f\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\u3082\u5145\u5b9f\u3057\u3066\u304a\u308a\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u81ea\u7531\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3084\u6642\u9593\u60c5\u5831\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001PHP\u3067\u306e\u65e5\u4ed8\u64cd\u4f5c\u304c\u7c21\u5358\u304b\u3064\u52b9\u7387\u7684\u306b\u884c\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u6307\u5b9a\u3057\u3066\u65e5\u6642\u3092\u8868\u793a\u3059\u308b<\/strong><\/h3>\n\n\n\n<p>DateTime\u30af\u30e9\u30b9\u3067\u306f\u3001\u4efb\u610f\u306e\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u8a2d\u5b9a\u3057\u3066\u65e5\u6642\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u300cAsia\/Tokyo\u300d\u306b\u8a2d\u5b9a\u3057\u3001\u73fe\u5728\u306e\u65e5\u6642\u3092\u8868\u793a\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>$date = new DateTime(&quot;now&quot;, new DateTimeZone(&quot;Asia\/Tokyo&quot;));\necho $date-&gt;format(&#39;Y-m-d H:i:s&#39;);<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001DateTimeZone\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u300cAsia\/Tokyo\u300d\u3068\u3044\u3046\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u6307\u5b9a\u3057\u3001\u305d\u306e\u8a2d\u5b9a\u3092\u6301\u3064DateTime\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u3066\u3044\u307e\u3059\u3002format\u30e1\u30bd\u30c3\u30c9\u3067\u65e5\u6642\u3092\u51fa\u529b\u3059\u308b\u3068\u3001\u6307\u5b9a\u3057\u305f\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306b\u57fa\u3065\u3044\u305f\u65e5\u6642\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u899a\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u3055\u3089\u306b\u3001DateTimeZone\u306b\u306f\u4ed6\u306b\u3082\u591a\u304f\u306e\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u5730\u57df\u306b\u5408\u308f\u305b\u305f\u65e5\u6642\u306e\u8868\u793a\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u306e\u6a5f\u80fd\u306b\u3088\u308a\u3001\u7570\u306a\u308b\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u9593\u306e\u65e5\u6642\u7ba1\u7406\u304c\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u904e\u53bb\u30fb\u672a\u6765\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5<\/strong><\/h2>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-15.11.23.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u30da\u30f3\u535a\u58eb<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u3053\u3053\u3067\u306f\u3001\u904e\u53bb\u30fb\u672a\u6765\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3059\u308b\u305e\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>\u904e\u53bb\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b<\/strong><\/h3>\n\n\n\n<p>PHP\u3067\u904e\u53bb\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001DateTime\u30af\u30e9\u30b9\u306emodify\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u7c21\u5358\u306b\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u73fe\u5728\u306e\u65e5\u4ed8\u304b\u30891\u9031\u9593\u524d\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3001\u6b21\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>$date = new DateTime();\n$date-&gt;modify(&#39;-7 day&#39;);\necho $date-&gt;format(&#39;Y-m-d&#39;);<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001modify(&#8216;-7 day&#8217;)\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u30011\u9031\u9593\u524d\u306e\u65e5\u4ed8\u3092\u751f\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u65b9\u6cd5\u306f\u3001&#8221;-1 month&#8221;\u3084&#8221;-1 year&#8221;\u306e\u3088\u3046\u306b\u65e5\u4ed8\u3092\u67d4\u8edf\u306b\u8abf\u6574\u3067\u304d\u308b\u305f\u3081\u3001\u5fc5\u8981\u306a\u904e\u53bb\u306e\u65e5\u4ed8\u3092\u7c21\u5358\u306b\u8a08\u7b97\u3059\u308b\u306e\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u904e\u53bb\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u969b\u306e\u6ce8\u610f\u70b9<\/strong><\/h3>\n\n\n\n<p>\u904e\u53bb\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u969b\u306b\u306f\u3001\u3044\u304f\u3064\u304b\u306e\u6ce8\u610f\u70b9\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u91cd\u8981\u306a\u306e\u306f\u3001<strong><span class=\"swl-marker mark_yellow\">\u65e5\u4ed8\u8a08\u7b97\u304c\u6b63\u78ba\u306b\u306a\u308b\u3088\u3046\u3001\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068<\/span><\/strong>\u3067\u3059\u3002\u7570\u306a\u308b\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3067\u65e5\u6642\u8a08\u7b97\u3092\u884c\u3046\u3068\u3001\u53d6\u5f97\u7d50\u679c\u304c\u305a\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u305f\u3081\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066DateTimeZone\u30af\u30e9\u30b9\u3067\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u904e\u53bb\u306e\u65e5\u4ed8\u53d6\u5f97\u306b\u4f34\u3046\u6f5c\u5728\u7684\u306a\u30a8\u30e9\u30fc\u3092\u9632\u3050\u305f\u3081\u306b\u3082\u3001PHP\u306e\u65e5\u4ed8\u95a2\u6570\u3084DateTime\u30af\u30e9\u30b9\u306e\u4f7f\u3044\u65b9\u306b\u6163\u308c\u3066\u304a\u304f\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-15.13.05.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u30da\u30f3\u535a\u58eb<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>modify\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u65e5\u4ed8\u3092\u8abf\u6574\u3059\u308b\u969b\u306b\u306f\u3001\u300c-1 day\u300d\u300c-1 month\u300d\u306e\u3088\u3046\u306b\u8868\u73fe\u3059\u308b\u304c\u3001\u7279\u5b9a\u306e\u6708\u306e\u672b\u65e5\u3084\u3046\u308b\u3046\u5e74\u3092\u306a\u3069\u306e\u5834\u5408\u3001\u65e5\u4ed8\u304c\u610f\u56f3\u901a\u308a\u306b\u8abf\u6574\u3055\u308c\u306a\u3044\u5834\u5408\u3082\u3042\u308b\u305e\u3002<\/strong><br><br><strong>\u4f8b\u3048\u3070\u30013\u670831\u65e5\u304b\u30891\u304b\u6708\u524d\u3092\u6307\u5b9a\u3059\u308b\u3068\u30012\u6708\u306e\u672b\u65e5\uff082\u670828\u65e5\u307e\u305f\u306f29\u65e5\uff09\u306b\u306a\u308b\u305f\u3081\u3001\u6708\u6570\u306e\u8a08\u7b97\u3092\u884c\u3046\u969b\u306b\u306f\u3053\u3046\u3057\u305f\u4f8b\u5916\u3092\u8003\u616e\u3059\u308b\u3053\u3068\u304c\u5fc5\u8981\u3058\u3083\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>\u672a\u6765\u306e\u65e5\u4ed8\u3092\u6307\u5b9a\u3057\u3066\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3092\u7ba1\u7406\u3059\u308b<\/strong><\/h3>\n\n\n\n<p>\u672a\u6765\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u3067\u3001\u30a4\u30d9\u30f3\u30c8\u3084\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u304c\u7c21\u5358\u3067\u3059\u3002PHP\u306eDateTime\u30af\u30e9\u30b9\u3068modify\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3048\u3070\u3001\u7279\u5b9a\u306e\u65e5\u6570\u3084\u6708\u6570\u3092\u52a0\u7b97\u3057\u3066\u3001\u672a\u6765\u306e\u65e5\u4ed8\u3092\u7c21\u5358\u306b\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u4eca\u65e5\u304b\u30891\u304b\u6708\u5f8c\u306e\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3092\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>$date = new DateTime();\n$date-&gt;modify(&#39;+1 month&#39;);\necho $date-&gt;format(&#39;Y-m-d&#39;);<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001modify(&#8216;+1 month&#8217;)\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u30011\u304b\u6708\u5f8c\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002\u65e5\u6570\u3067\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u300c+7 days\u300d\u3084\u300c+30 days\u300d\u3068\u66f8\u304f\u3053\u3068\u3067\u67d4\u8edf\u306b\u5909\u66f4\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong><span class=\"swl-marker mark_yellow\">\u672a\u6765\u306e\u65e5\u4ed8\u306e\u53d6\u5f97\u306f\u3001\u30bf\u30b9\u30af\u306e\u30ea\u30de\u30a4\u30f3\u30c0\u30fc\u3084\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u306a\u3069\u3001\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u306b\u975e\u5e38\u306b\u6709\u52b9<\/span><\/strong>\u3067\u3059\u3002DateTime\u30af\u30e9\u30b9\u306e\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u8907\u96d1\u306a\u65e5\u4ed8\u8a08\u7b97\u3082\u7c21\u6f54\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u3001PHP\u306b\u3088\u308b\u52b9\u7387\u7684\u306a\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u304c\u5b9f\u73fe\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>PHP\u3067\u306e\u65e5\u4ed8\u64cd\u4f5c\u3068\u5fdc\u7528\u30c6\u30af\u30cb\u30c3\u30af<\/strong><\/h2>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-15.11.23.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u30da\u30f3\u535a\u58eb<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u3053\u3053\u3067\u306f\u3001PHP\u3067\u306e\u65e5\u4ed8\u64cd\u4f5c\u3068\u5fdc\u7528\u30c6\u30af\u30cb\u30c3\u30af\u3092\u89e3\u8aac\u3059\u308b\u305e\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<h3 class=\"wp-block-heading\"><strong>\u65e5\u4ed8\u3092\u4f7f\u3063\u305f\u6761\u4ef6\u5206\u5c90\u306e\u4f8b\uff08\u55b6\u696d\u65e5\u8a08\u7b97\u306a\u3069\uff09<\/strong><\/h3>\n\n\n\n<p>\u65e5\u4ed8\u3092\u4f7f\u3063\u305f\u6761\u4ef6\u5206\u5c90\u306f\u3001\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u3084\u55b6\u696d\u65e5\u8a08\u7b97\u306a\u3069\u3067\u975e\u5e38\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002PHP\u3067\u306f\u3001DateTime\u30af\u30e9\u30b9\u3084date\u95a2\u6570\u3092\u4f7f\u3063\u3066\u3001\u7279\u5b9a\u306e\u65e5\u4ed8\u304c\u5e73\u65e5\u304b\u4f11\u65e5\u304b\u3092\u5224\u5225\u3057\u3001\u6761\u4ef6\u5206\u5c90\u3092\u884c\u3046\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306f\u3001\u4eca\u65e5\u306e\u65e5\u4ed8\u304c\u5e73\u65e5\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308b\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>$date = new DateTime();\n$dayOfWeek = $date-&gt;format(&#39;N&#39;); \/\/ &#39;N&#39;\u306f1\uff08\u6708\u66dc\u65e5\uff09\u304b\u30897\uff08\u65e5\u66dc\u65e5\uff09\u306e\u6570\u5024\u3092\u8fd4\u3059\nif ($dayOfWeek &gt;= 1 && $dayOfWeek &lt;= 5) {\n\u00a0\u00a0\u00a0\u00a0echo &quot;\u4eca\u65e5\u306f\u55b6\u696d\u65e5\u3067\u3059\u3002&quot;;\n} else {\n\u00a0\u00a0\u00a0\u00a0echo &quot;\u4eca\u65e5\u306f\u4f11\u65e5\u3067\u3059\u3002&quot;;\n}<\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001format(&#8216;N&#8217;)\u3092\u4f7f\u3063\u3066\u66dc\u65e5\u3092\u6570\u5024\u3067\u53d6\u5f97\u3057\u3001<strong><span class=\"swl-marker mark_yellow\">1\u304b\u30895\u306e\u9593\u3067\u3042\u308c\u3070\u55b6\u696d\u65e5\u3001\u305d\u308c\u4ee5\u5916\u306a\u3089\u4f11\u65e5\u3068\u5224\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/strong>\u3055\u3089\u306b\u3001\u7279\u5b9a\u306e\u4f11\u65e5\u3092\u914d\u5217\u306b\u767b\u9332\u3057\u3066\u304a\u304d\u3001\u305d\u308c\u3068\u4e00\u81f4\u3059\u308b\u65e5\u4ed8\u306f\u55b6\u696d\u65e5\u3068\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3001\u5b9f\u52d9\u7684\u306a\u30ab\u30ec\u30f3\u30c0\u30fc\u7ba1\u7406\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-15.09.27.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u30da\u30f3\u535a\u58eb<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u4eee\u306b\u30013\u55b6\u696d\u65e5\u4ee5\u5185\u306b\u7279\u5b9a\u306e\u51e6\u7406\u3092\u884c\u3044\u305f\u3044\u3068\u3044\u3063\u305f\u30b7\u30ca\u30ea\u30aa\u3067\u306f\u3001modify(&#8216;+1 day&#8217;)\u3092\u30eb\u30fc\u30d7\u3067\u7e70\u308a\u8fd4\u3057\u306a\u304c\u3089\u571f\u65e5\u3084\u4f11\u65e5\u3092\u30b9\u30ad\u30c3\u30d7\u3059\u308b\u30ed\u30b8\u30c3\u30af\u3082\u7d44\u3080\u3053\u3068\u304c\u3067\u304d\u3001\u6b63\u78ba\u306a\u55b6\u696d\u65e5\u8a08\u7b97\u304c\u53ef\u80fd\u3058\u3083\u3002\u305d\u306e\u305f\u3081\u3001\u7d0d\u671f\u3084\u671f\u9650\u7ba1\u7406\u306a\u3069\u3067\u975e\u5e38\u306b\u5f79\u7acb\u3064\u305e\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>$date = new DateTime();\n$businessDays = 3; \/\/ \u5fc5\u8981\u306a\u55b6\u696d\u65e5\u6570\n$counter = 0;\n\/\/ \u795d\u65e5\u30ea\u30b9\u30c8\u3092\u6307\u5b9a\uff08\u4f8b\u3068\u3057\u3066\u5143\u65e5\u3068\u5efa\u56fd\u8a18\u5ff5\u65e5\uff09\n$holidays = [\n\u00a0\u00a0\u00a0\u00a0&#39;2024-01-01&#39;, \/\/ \u5143\u65e5\n\u00a0\u00a0\u00a0\u00a0&#39;2024-02-11&#39;, \/\/ \u5efa\u56fd\u8a18\u5ff5\u65e5\n];\nwhile ($counter &lt; $businessDays) {\n\u00a0\u00a0\u00a0\u00a0$date-&gt;modify(&#39;+1 day&#39;);\n\u00a0\u00a0\u00a0\u00a0$dayOfWeek = $date-&gt;format(&#39;N&#39;); \/\/ &#39;N&#39;\u306f1\uff08\u6708\u66dc\u65e5\uff09\u304b\u30897\uff08\u65e5\u66dc\u65e5\uff09\u306e\u6570\u5024\u3092\u8fd4\u3059\n\u00a0\u00a0\u00a0\u00a0\/\/ \u571f\u65e5\u304a\u3088\u3073\u795d\u65e5\u30ea\u30b9\u30c8\u306b\u542b\u307e\u308c\u308b\u65e5\u4ed8\u3092\u30b9\u30ad\u30c3\u30d7\n\u00a0\u00a0\u00a0\u00a0if ($dayOfWeek &lt; 6 && !in_array($date-&gt;format(&#39;Y-m-d&#39;), $holidays)) {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$counter++;\n\u00a0\u00a0\u00a0\u00a0}\n}\n\/\/ \u7d50\u679c\u3092\u8868\u793a\necho &quot;3\u55b6\u696d\u65e5\u5f8c\u306e\u65e5\u4ed8\u306f &quot; . $date-&gt;format(&#39;Y-m-d&#39;) . &quot; \u3067\u3059\u3002&quot;;<\/code><\/pre><\/div>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u307e\u305a\u3001$date\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u73fe\u5728\u306e\u65e5\u4ed8\u304b\u3089\u958b\u59cb\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>$businessDays\u306b\u306f\u5fc5\u8981\u306a\u55b6\u696d\u65e5\u6570\uff08\u4eca\u56de\u306f3\u55b6\u696d\u65e5\uff09\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u795d\u65e5\u3092\u30ea\u30b9\u30c8\uff08\u914d\u5217\uff09\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u3001\u8a72\u5f53\u306e\u65e5\u4ed8\u3092\u30b9\u30ad\u30c3\u30d7\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>while\u30eb\u30fc\u30d7\u3067\u65e5\u4ed8\u30921\u65e5\u305a\u3064\u9032\u3081\u3001\u571f\u65e5\uff08\u9031\u672b\uff09\u3084\u795d\u65e5\u30ea\u30b9\u30c8\u306b\u542b\u307e\u308c\u308b\u65e5\u4ed8\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u306a\u304c\u3089\u30ab\u30a6\u30f3\u30bf\u30fc\u3092\u9032\u3081\u3066\u3044\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li>echo\u30673\u55b6\u696d\u65e5\u5f8c\u306e\u65e5\u4ed8\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u308c\u3067\u30013\u55b6\u696d\u65e5\u5f8c\u306e\u65e5\u4ed8\u3092\u571f\u65e5\u3084\u7279\u5b9a\u306e\u795d\u65e5\u3092\u9664\u5916\u3057\u305f\u5f62\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>PHP\u306e\u65e5\u4ed8\u95a2\u6570\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u55b6\u696d\u65e5\u306e\u8a08\u7b97\u3084\u52d5\u7684\u306a\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u304c\u67d4\u8edf\u306b\u884c\u3048\u3001\u5b9f\u7528\u7684\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7c21\u5358\u306b\u7d44\u307f\u7acb\u3066\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-14.48.08.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u751f\u5f92<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u30da\u30f3\u535a\u58eb\u3001\u4eca\u65e5\u3060\u3051\u3067PHP\u306e\u65e5\u4ed8\u53d6\u5f97\u306e\u57fa\u672c\u304c\u3070\u3063\u3061\u308a\u5206\u304b\u308a\u307e\u3057\u305f\uff01<code>date()<\/code>\u3084<code>DateTime<\/code>\u30af\u30e9\u30b9\u306a\u3069\u3001\u601d\u3063\u3066\u305f\u3088\u308a\u4f7f\u3044\u9053\u304c\u591a\u3044\u3067\u3059\u306d\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-right\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-15.12.07.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u30da\u30f3\u535a\u58eb<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u3046\u3080\u3001\u305d\u308c\u304c\u5206\u304b\u308c\u3070\u3082\u3046\u7acb\u6d3e\u306a\u7b2c\u4e00\u6b69\u3058\u3083\u3002\u65e5\u4ed8\u306f\u3042\u3089\u3086\u308bWeb\u30a2\u30d7\u30ea\u306b\u6b20\u304b\u305b\u306c\u8981\u7d20\u3002\u30ed\u30b0\u306e\u8a18\u9332\u3084\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u3001\u30d6\u30ed\u30b0\u306e\u6295\u7a3f\u65e5\u6642\u306a\u3069\u3001\u6d3b\u8e8d\u306e\u5834\u306f\u7121\u9650\u3058\u3083\u305e<\/strong>\uff01<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__icon -square\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2025\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2025-06-15-15.06.05.jpg\" alt=\"\" class=\"c-balloon__iconImg\" width=\"80px\" height=\"80px\"><span class=\"c-balloon__iconName\">\u751f\u5f92<\/span><\/div><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p><strong>\u306f\u3044\u3063\uff01\u65e9\u901f\u6d3b\u7528\u3057\u3066\u307f\u307e\u3059\uff01\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\uff01<\/strong><\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>\u307e\u3068\u3081<\/strong><\/h2>\n\n\n\n<p>PHP\u3067\u306e\u65e5\u4ed8\u53d6\u5f97\u3068\u64cd\u4f5c\u306e\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3001\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u7684\u306a\u95a2\u6570\u3068DateTime\u30af\u30e9\u30b9\u306e\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\u3057\u3066\u304d\u307e\u3057\u305f\u3002PHP\u306b\u306fdate\u95a2\u6570\u3068DateTime\u30af\u30e9\u30b9\u3068\u3044\u3046\u30c4\u30fc\u30eb\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br><br>\u305d\u308c\u305e\u308c\u306e\u65b9\u6cd5\u3092\u7406\u89e3\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u4ee5\u4e0b\u306e\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"is-style-big_icon_point\"><strong>\u73fe\u5728\u306e\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u53d6\u5f97<br>\u904e\u53bb\u30fb\u672a\u6765\u306e\u65e5\u4ed8\u306e\u8a08\u7b97\uff08+1\u65e5\u3001-3\u30f6\u6708 \u306a\u3069\uff09<br>\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306e\u5909\u66f4<br>\u65e5\u4ed8\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\uff08\u4f8b\uff1a<code>Y-m-d H:i:s<\/code>\uff09<\/strong><\/p>\n\n\n\n<p>\u307e\u305f\u3001\u4f7f\u3048\u308b\u4e3b\u306a\u5834\u9762\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"is-style-big_icon_check\"><strong>\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u3084\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u306a\u3069<br>\u30c7\u30fc\u30bf\u306e\u8a18\u9332\u3084\u30ed\u30b0\u7ba1\u7406<br>\u65e5\u4ed8\u3092\u6271\u3046\u30ed\u30b8\u30c3\u30af\u3092\u81ea\u52d5\u5316\u3067\u304d\u308b\uff08\u9031\u6b21\u30fb\u6708\u6b21\u51e6\u7406\u306a\u3069\uff09<\/strong><\/p>\n\n\n\n<p>\u5404\u30b3\u30fc\u30c9\u4f8b\u3092\u53c2\u8003\u306b\u3057\u306a\u304c\u3089\u3001\u3054\u81ea\u8eab\u3067\u8a66\u3057\u3066\u307f\u308b\u3053\u3068\u3067\u3001\u65e5\u4ed8\u64cd\u4f5c\u306e\u7406\u89e3\u304c\u3055\u3089\u306b\u6df1\u307e\u308b\u3067\u3057\u3087\u3046\u3002PHP\u306e\u65e5\u4ed8\u95a2\u6570\u3092\u30de\u30b9\u30bf\u30fc\u3059\u308b\u3053\u3068\u3067\u3001<strong><span class=\"swl-marker mark_yellow\">\u3088\u308a\u52b9\u679c\u7684\u3067\u67d4\u8edf\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u69cb\u7bc9\u3067\u304d\u308b<\/span><\/strong>\u3088\u3046\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"index_id17\">WithCode\u3092\u4f53\u9a13\u3067\u304d\u308b\u521d\u7d1a\u30b3\u30fc\u30b9\u516c\u958b\u4e2d\uff01<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" width=\"600\" height=\"500\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2024\/04\/\u30d0\u30ca\u30fc_300\u00d7250_20240425.png\" alt=\"\" class=\"wp-image-2650\"\/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\">\u521d\u7d1a\u30b3\u30fc\u30b9(\u00a549,800)\u304c\u5b8c\u5168\u7121\u6599\u306b\uff01<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u671f\u9593\uff1a1\u9031\u9593<\/strong><\/li>\n\n\n\n<li><strong>\u5b66\u7fd2\u5185\u5bb9\uff1a<\/strong><br><strong>\u30ed\u30fc\u30c9\u30de\u30c3\u30d7\/\u57fa\u790e\u77e5\u8b58\/\u74b0\u5883\u69cb\u7bc9\/HTML\/CSS\/LP\u30fb\u30dd\u30fc\u30c8\u30d5\u30a9\u30ea\u30aa\u4f5c\u6210<\/strong><br><strong>\u2192 <span class=\"swl-marker mark_yellow\">\u6b63\u3057\u3044\u5b66\u7fd2\u65b9\u6cd5\u3067\u300c\u78ba\u304b\u306a\u6210\u9577\u300d\u3092\u5b9f\u611f\u3067\u304d\u308b\u30ab\u30ea\u30ad\u30e5\u30e9\u30e0\u3002<\/span><\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u526f\u696d\u30fb\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u304c\u4e3b\u6d41\u306b\u306a\u3063\u3066\u3044\u308b\u4eca\u3053\u305d\u3001\u81ea\u3089\u306e\u30b9\u30ad\u30eb\u3067\u7a3c\u3052\u308b\u4eba\u6750\u3092\u76ee\u6307\u3057\u3066\u307f\u307e\u305b\u3093\u304b\uff1f<\/p>\n\n\n\n<p>\u672a\u7d4c\u9a13\u3067\u3082\u5fc3\u914d\u3059\u308b\u3053\u3068\u3042\u308a\u307e\u305b\u3093\u3002\u521d\u7d1a\u30b3\u30fc\u30b9\u3092\u53d7\u8b1b\u3055\u308c\u308b\u65b9\u306e\u5927\u591a\u6570\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u672a\u7d4c\u9a13\u3067\u3059\u3002\u307e\u305a\u306f\u7121\u6599\u30ab\u30a6\u30f3\u30bb\u30ea\u30f3\u30b0\u3067\u3001\u60a9\u307f\u3084\u4e0d\u5b89\u3092\u304a\u805e\u304b\u305b\u304f\u3060\u3055\u3044\uff01<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-white-color has-text-color has-background has-link-color wp-element-button\" href=\"https:\/\/withcode.tech\/reservation\/\" style=\"background-color:#ffbf00\"><strong>\u516c\u5f0f\u30b5\u30a4\u30c8\u304b\u3089\u7121\u6599\u30ab\u30a6\u30f3\u30bb\u30ea\u30f3\u30b0\u306b\u7533\u3057\u8fbc\u3080<\/strong> <strong>\u2192<\/strong><\/a><\/div>\n<\/div>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>PHP\u3092\u4f7f\u3063\u3066\u65e5\u4ed8\u3084\u6642\u9593\u3092\u64cd\u4f5c\u3057\u305f\u3044\u3051\u308c\u3069\u3001\u3069\u3053\u304b\u3089\u59cb\u3081\u308c\u3070\u3044\u3044\u304b\u308f\u304b\u3089\u306a\u3044\u3068\u611f\u3058\u3066\u3044\u307e\u305b\u3093\u304b\uff1f \u672c\u8a18\u4e8b\u3067\u306f\u3001PHP\u306e\u57fa\u672c\u95a2\u6570\u3067\u3042\u308bdate\u95a2\u6570\u304b\u3089\u3001\u67d4\u8edf\u306a\u65e5\u4ed8\u64cd\u4f5c\u304c\u53ef\u80fd\u306aDateTime\u30af\u30e9\u30b9\u306e\u4f7f\u3044\u65b9\u307e\u3067\u3001\u5177\u4f53\u7684\u306a\u30b3\u30fc [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":7140,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"swell_btn_cv_data":"","footnotes":""},"categories":[34,367],"tags":[37,66,114,246],"class_list":["post-7138","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","category-php","tag-programming","tag-web","tag-php","tag-246"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/7138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/comments?post=7138"}],"version-history":[{"count":7,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/7138\/revisions"}],"predecessor-version":[{"id":10494,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/7138\/revisions\/10494"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/media\/7140"}],"wp:attachment":[{"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/media?parent=7138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/categories?post=7138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/tags?post=7138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}