{"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-08-17T15:02:09","modified_gmt":"2026-08-17T15:02:09","slug":"php-date","status":"publish","type":"post","link":"https:\/\/withcode.tech\/media\/php-date\/","title":{"rendered":"PHP\u65e5\u4ed8\u53d6\u5f97\u306e\u5b8c\u5168\u30ac\u30a4\u30c9|date()\u95a2\u6570\u3068DateTime\u6d3b\u7528\u6cd5"},"content":{"rendered":"\n<!-- withmedia-ketsuron -->\n<h2 class=\"wp-block-heading\">\u3053\u306e\u8a18\u4e8b\u306e\u7d50\u8ad6<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">PHP\u3067\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001\u30b7\u30f3\u30d7\u30eb\u306b\u73fe\u5728\u306e\u65e5\u4ed8\u3084\u6642\u523b\u3092\u51fa\u529b\u3067\u304d\u308bdate\u95a2\u6570\u3068\u3001\u3088\u308a\u8a73\u7d30\u3067\u67d4\u8edf\u306a\u64cd\u4f5c\u304c\u53ef\u80fd\u306aDateTime\u30af\u30e9\u30b9\u306e2\u3064\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002date\u95a2\u6570\u306f\u300cY-m-d\u300d\u306e\u3088\u3046\u306b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3057\u3066\u5e74\u6708\u65e5\u3084\u6642\u523b\u3092\u53d6\u5f97\u3067\u304d\u3001DateTime\u30af\u30e9\u30b9\u306f\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306e\u6307\u5b9a\u3084modify\u30e1\u30bd\u30c3\u30c9\u306b\u3088\u308b\u904e\u53bb\u30fb\u672a\u6765\u306e\u65e5\u4ed8\u8a08\u7b97\u306b\u5f37\u307f\u304c\u3042\u308a\u307e\u3059\u3002\u55b6\u696d\u65e5\u8a08\u7b97\u306a\u3069\u306e\u6761\u4ef6\u5206\u5c90\u306b\u3082\u5fdc\u7528\u3067\u304d\u3001\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u3084\u30ed\u30b0\u8a18\u9332\u306a\u3069\u5e45\u5e83\u3044\u5834\u9762\u3067\u6d3b\u7528\u3067\u304d\u307e\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.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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\"><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 wp-block-paragraph\">\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 wp-block-paragraph\"><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 class=\"wp-block-paragraph\">\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 wp-block-paragraph\"><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\u308b3\u3064\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>\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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\u3067\u65e5\u4ed8\u3092\u81ea\u7531\u306b\u64cd\u4f5c\u3059\u308b\u306b\u306f?<\/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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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\u8a08\u7b97\u30fb\u53d6\u5f97\u3059\u308b\u5b9f\u88c5\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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\"><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\u65e5\u4ed8\u64cd\u4f5c\u306e\u5fdc\u7528\u30c6\u30af\u30cb\u30c3\u30af5\u9078<\/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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">\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 class=\"wp-block-paragraph\">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 class=\"wp-block-paragraph\">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 wp-block-paragraph\"><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 class=\"wp-block-paragraph\">\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 wp-block-paragraph\"><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 class=\"wp-block-paragraph\">\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<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<!-- withmedia-related -->\n<h2 class=\"wp-block-heading\">\u95a2\u9023\u8a18\u4e8b<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/withcode.tech\/media\/php-uppercase-lowercase\/\">PHP\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u5909\u63db\u3010\u5b8c\u5168\u30ac\u30a4\u30c9\u3011\u5b9f\u52d9\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3067\u7fd2\u5f97<\/a><\/li>\n<li><a href=\"https:\/\/withcode.tech\/media\/php-truncate-decimal-point\/\">PHP\u5c0f\u6570\u70b9\u51e6\u7406\u3010\u5b8c\u5168\u30ac\u30a4\u30c9\u3011\u5207\u308a\u6368\u3066\u30fb\u5207\u308a\u4e0a\u3052\u30fb\u56db\u6368\u4e94\u5165<\/a><\/li>\n<li><a href=\"https:\/\/withcode.tech\/media\/php-engineer-future\/\">PHP\u5c06\u6765\u6027\u5b8c\u5168\u30ac\u30a4\u30c9|2026\u5e74\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u9700\u8981\u3068\u6280\u8853\u30c8\u30ec\u30f3\u30c9<\/a><\/li>\n<li><a href=\"https:\/\/withcode.tech\/media\/php-basic-grammar\/\">PHP\u57fa\u672c\u6587\u6cd5\u3092\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u521d\u5fc3\u8005\u5411\u3051\u5b9f\u4f8b\u30b3\u30fc\u30c9\u4ed8\u304d\u89e3\u8aac<\/a><\/li>\n<li><a href=\"https:\/\/withcode.tech\/media\/engineer_hard_work\">\u3010\u30a8\u30f3\u30b8\u30cb\u30a2\u3011\u304d\u3064\u304f\u3066\u5927\u5909\uff01\u514b\u670d\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\uff01<\/a><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<!-- withmedia-references -->\n<h2 class=\"wp-block-heading\">\u53c2\u8003\u30ea\u30f3\u30af\uff08\u516c\u5f0f\u30fb\u4e00\u6b21\u60c5\u5831\uff09<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.php.net\/manual\/ja\/\" target=\"_blank\" rel=\"noopener noreferrer\">PHP \u516c\u5f0f\u30de\u30cb\u30e5\u30a2\u30eb<\/a><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<!-- withmedia-faq -->\n<h2 class=\"wp-block-heading\">\u3088\u304f\u3042\u308b\u8cea\u554f\uff08FAQ\uff09<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Q1. PHP\u3067\u4eca\u65e5\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u3067\u3059\u304b\uff1f<\/h3>\n\n\n<p class=\"wp-block-paragraph\"><strong>A.<\/strong> date\u95a2\u6570\u3092\u4f7f\u3046\u306e\u304c\u6700\u3082\u57fa\u672c\u7684\u306a\u65b9\u6cd5\u3067\u3059\u3002\u4f8b\u3048\u3070\u300cY-m-d\u300d\u3068\u3044\u3046\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3059\u308b\u3068\u300c2024-10-16\u300d\u306e\u3088\u3046\u306a\u5f62\u3067\u73fe\u5728\u306e\u5e74\u6708\u65e5\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002Y\u3067\u5e74\u3001m\u3067\u6708\u3001d\u3067\u65e5\u3092\u8868\u73fe\u3057\u3001\u300cY-m-d H:i:s\u300d\u306e\u3088\u3046\u306b\u6642\u5206\u79d2\u3082\u4e00\u62ec\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q2. date\u95a2\u6570\u3068DateTime\u30af\u30e9\u30b9\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h3>\n\n\n<p class=\"wp-block-paragraph\"><strong>A.<\/strong> date\u95a2\u6570\u306f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3057\u3066\u30b7\u30f3\u30d7\u30eb\u306b\u73fe\u5728\u306e\u65e5\u4ed8\u3084\u6642\u523b\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002DateTime\u30af\u30e9\u30b9\u306f\u65e5\u4ed8\u3084\u6642\u9593\u3092\u3088\u308a\u8a73\u7d30\u306b\u6271\u3048\u3001\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306e\u6307\u5b9a\u3084\u65e5\u6642\u306e\u8a08\u7b97\u3068\u3044\u3063\u305f\u8907\u96d1\u3067\u9ad8\u5ea6\u306a\u64cd\u4f5c\u306b\u5411\u3044\u3066\u3044\u307e\u3059\u3002\u7528\u9014\u306b\u5fdc\u3058\u3066\u4f7f\u3044\u5206\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q3. PHP\u3067\u904e\u53bb\u3084\u672a\u6765\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\uff1f<\/h3>\n\n\n<p class=\"wp-block-paragraph\"><strong>A.<\/strong> DateTime\u30af\u30e9\u30b9\u306emodify\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070modify(&#8216;-7 day&#8217;)\u30671\u9031\u9593\u524d\u3001modify(&#8216;+1 month&#8217;)\u30671\u304b\u6708\u5f8c\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u300c-1 month\u300d\u300c+30 days\u300d\u306e\u3088\u3046\u306b\u67d4\u8edf\u306b\u6307\u5b9a\u3067\u304d\u3001\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u3084\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q4. PHP\u3067\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u6307\u5b9a\u3057\u3066\u65e5\u6642\u3092\u8868\u793a\u3059\u308b\u306b\u306f\uff1f<\/h3>\n\n\n<p class=\"wp-block-paragraph\"><strong>A.<\/strong> DateTimeZone\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u300cAsia\/Tokyo\u300d\u3092\u6307\u5b9a\u3057\u305fDateTimeZone\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u3001\u305d\u308c\u3092\u6301\u3064DateTime\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092format\u30e1\u30bd\u30c3\u30c9\u3067\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\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q5. \u904e\u53bb\u306e\u65e5\u4ed8\u3092\u8a08\u7b97\u3059\u308b\u969b\u306e\u6ce8\u610f\u70b9\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h3>\n\n\n<p class=\"wp-block-paragraph\"><strong>A.<\/strong> \u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3001\u7570\u306a\u308b\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3067\u8a08\u7b97\u3059\u308b\u3068\u7d50\u679c\u304c\u305a\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305fmodify\u3067\u300c-1 month\u300d\u3092\u4f7f\u3046\u3068\u30013\u670831\u65e5\u306e1\u304b\u6708\u524d\u304c2\u6708\u672b\u65e5\u306b\u306a\u308b\u306a\u3069\u3001\u6708\u672b\u65e5\u3084\u3046\u308b\u3046\u5e74\u3067\u610f\u56f3\u901a\u308a\u306b\u8abf\u6574\u3055\u308c\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u305f\u3081\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n\n<h2 class=\"wp-block-heading\">AI\u30b9\u30ad\u30eb\u3067\u3001\u672a\u6765\u306e\u81ea\u5206\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\uff01<\/h2>\n\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/s.lmes.jp\/landing-qr\/2010578884-C5To3Fmv?uLand=phzKXf\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" width=\"1254\" height=\"1254\" src=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2026\/07\/withai-cta-banner.jpg\" alt=\"\u4eca\u306a\u3089\u5b8c\u5168\u7121\u6599\u3067AI\u3092\u5b66\u3079\u308b\uff01WithAI\" class=\"wp-image-18841\" style=\"max-width:600px;width:100%;height:auto\" srcset=\"https:\/\/withcode.tech\/media\/wp-content\/uploads\/2026\/07\/withai-cta-banner.jpg 1254w, https:\/\/withcode.tech\/media\/wp-content\/uploads\/2026\/07\/withai-cta-banner-768x768.jpg 768w\" sizes=\"(max-width: 1254px) 100vw, 1254px\" \/><\/a><\/figure>\n\n<h3 class=\"wp-block-heading\">\u4eca\u306a\u3089\u5b8c\u5168\u7121\u6599\u3067AI\u3092\u5b66\u3079\u308b\uff01<\/h3>\n\n<ul class=\"wp-block-list\">\n<li><strong>\u52d5\u753b\u3084\u5b9f\u8df5\u3067\u697d\u3057\u304f\u5b66\u3079\u308b<\/strong>\uff1a\u521d\u5fc3\u8005\u3067\u3082\u5b89\u5fc3\u306e\u30ab\u30ea\u30ad\u30e5\u30e9\u30e0<\/li>\n<li><strong>\u30b9\u30de\u30db\u30fbPC\u3069\u3061\u3089\u3067\u3082OK<\/strong>\uff1a\u597d\u304d\u306a\u6642\u9593\u306b\u5b66\u7fd2\u3067\u304d\u308b<\/li>\n<li><strong>\u6599\u91d1\u306f\u4e00\u5207\u30ca\u30b7<\/strong>\uff1a<span class=\"swl-marker mark_yellow\">0\u5186\u3067AI\u30b9\u30ad\u30eb\u304c\u8eab\u306b\u3064\u304f<\/span><\/li>\n<\/ul>\n\n<p>\u76ee\u7684\u306b\u5408\u308f\u305b\u3066\u9078\u3079\u308b\u300cAI\u526f\u696d\u300d\u300cAI\u8ee2\u8077\u300d\u300cAI\u6d3b\u7528\u300d\u306e3\u30b3\u30fc\u30b9\u3092\u7528\u610f\u3002\u526f\u53ce\u5165\u30fb\u30ad\u30e3\u30ea\u30a2\u30c1\u30a7\u30f3\u30b8\u30fb\u65e5\u5e38\u306e\u751f\u7523\u6027\u30a2\u30c3\u30d7\u307e\u3067\u3001\u3042\u306a\u305f\u306e\u30b4\u30fc\u30eb\u306b\u5408\u308f\u305b\u3066AI\u3092\u5b66\u3079\u307e\u3059\u3002<\/p>\n\n<p>\u4f1a\u54e1\u767b\u9332\u306f\u30ab\u30f3\u30bf\u30f330\u79d2\u3067\u5b8c\u4e86\u3057\u307e\u3059\u3002\u307e\u305a\u306f\u516c\u5f0fLINE\u304b\u3089\u3001\u7121\u6599\u3067AI\u5b66\u7fd2\u3092\u30b9\u30bf\u30fc\u30c8\u3057\u307e\u3057\u3087\u3046\uff01<\/p>\n\n<div class=\"wp-block-buttons\"><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:\/\/s.lmes.jp\/landing-qr\/2010578884-C5To3Fmv?uLand=phzKXf\" target=\"_blank\" rel=\"noopener noreferrer\" style=\"background-color:#06c755\"><strong>\u516c\u5f0fLINE\u304b\u3089\u5b66\u7fd2\u3092\u30b9\u30bf\u30fc\u30c8<\/strong><\/a><\/div><\/div>\n\n\n<!-- withmedia-faq-schema -->\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n    {\n      \"@type\": \"Question\",\n      \"name\": \"PHP\u3067\u4eca\u65e5\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3088\u3044\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"date\u95a2\u6570\u3092\u4f7f\u3046\u306e\u304c\u6700\u3082\u57fa\u672c\u7684\u306a\u65b9\u6cd5\u3067\u3059\u3002\u4f8b\u3048\u3070\u300cY-m-d\u300d\u3068\u3044\u3046\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3059\u308b\u3068\u300c2024-10-16\u300d\u306e\u3088\u3046\u306a\u5f62\u3067\u73fe\u5728\u306e\u5e74\u6708\u65e5\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002Y\u3067\u5e74\u3001m\u3067\u6708\u3001d\u3067\u65e5\u3092\u8868\u73fe\u3057\u3001\u300cY-m-d H:i:s\u300d\u306e\u3088\u3046\u306b\u6642\u5206\u79d2\u3082\u4e00\u62ec\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"date\u95a2\u6570\u3068DateTime\u30af\u30e9\u30b9\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"date\u95a2\u6570\u306f\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3057\u3066\u30b7\u30f3\u30d7\u30eb\u306b\u73fe\u5728\u306e\u65e5\u4ed8\u3084\u6642\u523b\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002DateTime\u30af\u30e9\u30b9\u306f\u65e5\u4ed8\u3084\u6642\u9593\u3092\u3088\u308a\u8a73\u7d30\u306b\u6271\u3048\u3001\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306e\u6307\u5b9a\u3084\u65e5\u6642\u306e\u8a08\u7b97\u3068\u3044\u3063\u305f\u8907\u96d1\u3067\u9ad8\u5ea6\u306a\u64cd\u4f5c\u306b\u5411\u3044\u3066\u3044\u307e\u3059\u3002\u7528\u9014\u306b\u5fdc\u3058\u3066\u4f7f\u3044\u5206\u3051\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"PHP\u3067\u904e\u53bb\u3084\u672a\u6765\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"DateTime\u30af\u30e9\u30b9\u306emodify\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070modify('-7 day')\u30671\u9031\u9593\u524d\u3001modify('+1 month')\u30671\u304b\u6708\u5f8c\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u300c-1 month\u300d\u300c+30 days\u300d\u306e\u3088\u3046\u306b\u67d4\u8edf\u306b\u6307\u5b9a\u3067\u304d\u3001\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u3084\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"PHP\u3067\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u6307\u5b9a\u3057\u3066\u65e5\u6642\u3092\u8868\u793a\u3059\u308b\u306b\u306f\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"DateTimeZone\u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u300cAsia\/Tokyo\u300d\u3092\u6307\u5b9a\u3057\u305fDateTimeZone\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u3001\u305d\u308c\u3092\u6301\u3064DateTime\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092format\u30e1\u30bd\u30c3\u30c9\u3067\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\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"\u904e\u53bb\u306e\u65e5\u4ed8\u3092\u8a08\u7b97\u3059\u308b\u969b\u306e\u6ce8\u610f\u70b9\u306f\u4f55\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3001\u7570\u306a\u308b\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3067\u8a08\u7b97\u3059\u308b\u3068\u7d50\u679c\u304c\u305a\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305fmodify\u3067\u300c-1 month\u300d\u3092\u4f7f\u3046\u3068\u30013\u670831\u65e5\u306e1\u304b\u6708\u524d\u304c2\u6708\u672b\u65e5\u306b\u306a\u308b\u306a\u3069\u3001\u6708\u672b\u65e5\u3084\u3046\u308b\u3046\u5e74\u3067\u610f\u56f3\u901a\u308a\u306b\u8abf\u6574\u3055\u308c\u306a\u3044\u5834\u5408\u304c\u3042\u308b\u305f\u3081\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\"\n      }\n    }\n  ]\n}\n<\/script>\n\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u306e\u7d50\u8ad6 PHP\u3067\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001\u30b7\u30f3\u30d7\u30eb\u306b\u73fe\u5728\u306e\u65e5\u4ed8\u3084\u6642\u523b\u3092\u51fa\u529b\u3067\u304d\u308bdate\u95a2\u6570\u3068\u3001\u3088\u308a\u8a73\u7d30\u3067\u67d4\u8edf\u306a\u64cd\u4f5c\u304c\u53ef\u80fd\u306aDateTime\u30af\u30e9\u30b9\u306e2\u3064\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002date\u95a2\u6570\u306f\u300cY-m-d\u300d\u306e\u3088\u3046\u306b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8 [&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,"swell_btn_cv_data":"","footnotes":"","vk-ltc-link":"","vk-ltc-target":"0"},"categories":[34,367],"tags":[37,66,114],"class_list":["post-7138","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","category-php","tag-programming","tag-web-production","tag-php"],"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":19,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/7138\/revisions"}],"predecessor-version":[{"id":19915,"href":"https:\/\/withcode.tech\/media\/wp-json\/wp\/v2\/posts\/7138\/revisions\/19915"}],"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}]}}