{"id":13512,"date":"2017-01-04T15:59:02","date_gmt":"2017-01-04T06:59:02","guid":{"rendered":"http:\/\/www.sejuku.net\/blog\/?p=13512"},"modified":"2024-05-06T11:40:00","modified_gmt":"2024-05-06T02:40:00","slug":"%e3%80%90%e5%ae%8c%e5%85%a8%e7%b6%b2%e7%be%85%e3%80%91ruby%e3%81%a7%e6%97%a5%e4%bb%98%e3%82%92%e6%89%b1%e3%81%8a%e3%81%86%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.sejuku.net\/blog\/13512","title":{"rendered":"\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09"},"content":{"rendered":"<p><div class=\"box_voice\"><br \/>\nRuby\u3067\u65e5\u4ed8\u306e\u6271\u3044\u65b9\u304c\u308f\u304b\u3089\u306a\u3044<br \/>\n\u65e5\u4ed8\u3092\u6271\u3046\u30af\u30e9\u30b9\u304c\u591a\u3059\u304e\u3066\u3069\u308c\u3092\u4f7f\u3048\u3070\u826f\u3044\u304b\u308f\u304b\u3089\u306a\u3044<br \/>\n\u65e5\u4ed8\u306e\u8a08\u7b97\u65b9\u6cd5\u304c\u308f\u304b\u3089\u306a\u3044<br \/>\n<\/div><\/p>\n<p>\u65e5\u4ed8\u3084\u6642\u523b\u306e\u64cd\u4f5c\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3059\u308b\u4e0a\u3067\u5fc5\u9808\u306e\u77e5\u8b58\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u3002\u3057\u304b\u3057Ruby\u3067\u65e5\u4ed8\u3084\u6642\u523b\u3092\u6271\u3046\u3068\u306a\u308b\u3068\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306a\u7591\u554f\u304c\u3067\u3066\u304f\u308b\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>\u305d\u3053\u3067\u3053\u306e\u8a18\u4e8b\u3067\u306f<b>ruby\u306e\u65e5\u4ed8\u3084\u6642\u523b\u306e\u6271\u3044\u65b9<\/b>\u306b\u3064\u3044\u3066\u3001\u57fa\u672c\u304b\u3089\u5fdc\u7528\u7684\u306a\u4f7f\u3044\u65b9\u307e\u3067\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>Ruby\u65e5\u4ed8\u3092\u6271\u3046\u305f\u3081\u306e\u30af\u30e9\u30b9<\/h2>\n<p>Ruby\u3067\u65e5\u4ed8\u3092\u6271\u3046\u30af\u30e9\u30b9\u306f\u3001\u4ee5\u4e0b\u306e3\u3064\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>Date\u30af\u30e9\u30b9<\/li>\n<li>DateTime\u30af\u30e9\u30b9<\/li>\n<li>Time\u30af\u30e9\u30b9<\/li>\n<\/ul>\n<p>\u305d\u308c\u3067\u306f\u3001\u305d\u308c\u305e\u308c\u306e\u4f7f\u3044\u65b9\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>Date\u30af\u30e9\u30b9<\/h3>\n<p>Date\u306f\u65e5\u4ed8\u3092\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u30af\u30e9\u30b9\u3067\u3001\u6642\u523b\u3092\u6271\u3046\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">\r\nrequire \"date\"\r\n \r\nputs date = Date.today  # 2019-06-26\r\nputs date.year          # 2019\r\nputs date.month         # 6\r\nputs date.day           # 26\r\nputs date.wday          # 3\r\nputs date.yday          # 177\r\n<\/pre>\n<p>\u4e0a\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u898b\u3066\u3044\u305f\u3060\u304f\u3068\u308f\u304b\u308b\u901a\u308a\u3001Date\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u306f\u3001date\u3068\u3044\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3092require\u3067\u8aad\u307f\u8fbc\u3080\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001year\u3084month\u306a\u3069\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u305d\u308c\u305e\u308c\u306e\u5024\u3092\u53d6\u308a\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Date\u30af\u30e9\u30b9\u3067\u6307\u5b9a\u3057\u305f\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \" >\r\nrequire \"date\"\r\n \r\n# \u6307\u5b9a\u3057\u305f\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\r\nputs date = Date.new(2018, 7, 30); # 2018-07-30\r\n<\/pre>\n<h3>DateTime\u30af\u30e9\u30b9<\/h3>\n<p>DateTime\u30af\u30e9\u30b9\u306f\u3001Date Time\u3068\u3044\u3046\u540d\u524d\u306e\u901a\u308a\u3001\u65e5\u4ed8\u3068\u6642\u9593\u3092\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">\r\nrequire \"date\"\r\n \r\nputs date = DateTime.now  # 2019-06-26T04:17:29+00:00\r\nputs date.year            # 2019\r\nputs date.hour            # 4\r\nputs date.min             # 17\r\nputs date.sec             # 29\r\nputs date.wday            # 3\r\nputs date.yday            # 177\r\nputs date.zone            # +00:00<\/pre>\n<p>DateTime\u30af\u30e9\u30b9\u306bnow\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u73fe\u5728\u306e\u65e5\u6642\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002DateTime\u3082Date\u3068\u540c\u3058\u304f\u3001date\u3092require\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>Time\u30af\u30e9\u30b9<\/h3>\n<p>Time\u30af\u30e9\u30b9\u306fDateTime\u3068\u540c\u3058\u304f\u3001\u65e5\u6642\u3068\u6642\u9593\u3092\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">\r\nputs date = Time.now  # 2019-06-26 04:19:39 +0000\r\nputs date.year        # 2019\r\nputs date.hour        # 4\r\nputs date.min         # 19\r\nputs date.sec         # 39\r\nputs date.wday        # 3\r\nputs date.yday        # 177 \u203b\u3053\u306e\u5e74\u306e1\u67081\u65e5\u304b\u3089\u4f55\u65e5\u7d4c\u904e\u3057\u305f\u304b\r\nputs date.zone        # UTC \u203b\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306e\u78ba\u8a8d\r\n<\/pre>\n<p>date\u3068\u540c\u3058\u3067\u201d.\u201d\u4ee5\u4e0b\u306b\u201dyear\u201d\u3084\u201dmin\u201d\u306a\u3069\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u5206\u3084\u6642\u9593\u306a\u3069\u306e\u60c5\u5831\u3092\u5207\u308a\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>Date\u3001DateTime\u3068Time\u306e\u5dee<\/h3>\n<p>\u3053\u3053\u307e\u3067\u4e09\u7a2e\u985e\u306e\u3001\u6642\u9593\u3092\u6271\u3046\u305f\u3081\u306e\u30af\u30e9\u30b9\u3092\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3057\u305f\u304c\u3001<\/p>\n<p><div class=\"box_voice\">\u6b63\u76f4\u4f55\u304c\u9055\u3046\u306e\u304b\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u2026<\/div><\/p>\n<p>\u3068\u611f\u3058\u305f\u65b9\u3082\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u4e9b\u7d30\u3067\u3059\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5dee\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>Time\u306e\u4f7f\u7528\u306brequire\u304c\u5fc5\u8981\u306a\u3044<\/li>\n<li>\u30b5\u30de\u30fc\u30bf\u30a4\u30e0\u304c\u6271\u3048\u308b<\/li>\n<li>\u3046\u308b\u3046\u79d2\u3092\u6570\u3048\u3089\u308c\u308b<\/li>\n<\/ul>\n<p>\u3053\u308c\u3092\u898b\u3066\u307f\u308b\u3068\u3001Time\u306e\u65b9\u304c\u5c11\u3057\u9ad8\u6a5f\u80fd\u306b\u306a\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001Ruby\u3067<b>\u65e5\u4ed8\u3001\u6642\u9593\u3092\u6271\u3046\u969b\u306f\u57fa\u672c\u7684\u306bTime\u3092\u4f7f\u7528<\/b>\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307e\u305f\u3001\u4ee5\u964d\u3053\u306e\u8a18\u4e8b\u306e\u89e3\u8aac\u3067\u306f\u65e5\u4ed8\u306e\u8a08\u7b97\u306fTime\u3092\u7528\u3044\u3066\u884c\u3044\u307e\u3059\u3002<\/p>\n<h2>\u65e5\u4ed8\u3092\u81ea\u5728\u306b\u64cd\u308b<\/h2>\n<p>\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3066\u3082\u3001\u305d\u308c\u3092\u64cd\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3068\u3001\u5b9f\u969b\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001\u3053\u306e\u7ae0\u3067\u306f\u65e5\u4ed8\u306e\u8a08\u7b97\u3084\u6bd4\u8f03\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001Time\u306f\u305d\u306e\u307e\u307e\u3060\u3068\u975e\u5e38\u306b\u64cd\u4f5c\u3057\u306b\u304f\u3044\u30af\u30e9\u30b9\u3067\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067active_support\u3092\u8a00\u3046gem\u3092\u7528\u3044\u3066\u64cd\u4f5c\u3057\u3066\u3044\u304d\u307e\u3059\uff01<\/p>\n<h3>active_support\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u307e\u305a\u306factive_support\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \">$ gem list<\/pre>\n<p><strong>[\u5b9f\u884c\u7d50\u679c]<\/strong>\u306b\u201dactivesupport\u201d\u304c\u306a\u3044\u5834\u5408\u306f\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \">$ gem install activesupport<\/pre>\n<p>\u518d\u5ea6\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u201dactivesupport\u201d\u304c\u3042\u308b\u304b\u8abf\u3079\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \">$ gem list<\/pre>\n<p>activesupport\u304c\u3042\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<h3>active_support\u3092\u7528\u3044\u305f\u6642\u9593\u306e\u52a0\u7b97\u3001\u6e1b\u7b97<\/h3>\n<p>\u305d\u308c\u3067\u306factive_support\u3092\u7528\u3044\u3066\u3001\u65e5\u4ed8\u306e\u52a0\u7b97\u3084\u6e1b\u7b97\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">\r\nrequire &quot;active_support\/time&quot;\r\n\r\ntime = Time.now\r\nputs time + 10     # 2019-06-26 13:25:31 +0900  \u203b10\u79d2\u5f8c\r\nputs time + 1.hour # 2019-06-26 14:25:21 +0900  \u203b1\u6642\u9593\u5f8c\r\nputs time + 1.week # 2019-07-03 13:25:21 +0900  \u203b1\u9031\u9593\u5f8c<\/pre>\n<p>\u3053\u3053\u3067\u4e00\u3064\u6ce8\u610f\u70b9\u306a\u306e\u3067\u3059\u304c<\/p>\n<pre class=\"lang:ruby decode:true \">require &quot;active_support&quot;<\/pre>\n<p>\u3067\u306factive_support\u306e\u4e2d\u306e\u9069\u5207\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u8aad\u307f\u8fbc\u307e\u308c\u305a\u3001\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">require &quot;active_support\/time&quot;<\/pre>\n<p>\u3068\u66f8\u304f\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002\u307e\u305f\u3001\u5358\u7d14\u306a\u52a0\u7b97\u3084\u6e1b\u7b97\u4ee5\u5916\u306b\u3082\u3001\u6628\u65e5\u3001\u660e\u65e5\u3001\u6765\u9031\u306a\u3069\u3092\u6c42\u3081\u308b\u30e1\u30bd\u30c3\u30c9\u3082\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">\r\nrequire &quot;active_support\/time&quot;\r\n\r\ntime = Time.now\r\nputs time.yesterday #\u6628\u65e5\r\nputs time.tomorrow #\u660e\u65e5\r\nputs time.prev_week#\u5148\u9031\r\nputs time.next_week#\u6765\u9031\r\nputs time.prev_month#\u5148\u6708\r\nputs time.next_month#\u6765\u6708\r\nputs time.prev_year#\u53bb\u5e74\r\nputs time.next_year#\u6765\u5e74<\/pre>\n<h3>\u6bd4\u8f03<\/h3>\n<p>\u6570\u5b57\u3068\u540c\u3058\u3088\u3046\u306b\u65e5\u4ed8\u3082\u3001\u4e0d\u7b49\u53f7\u3067\u6bd4\u8f03\u3092\u884c\u3046\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">\r\nrequire &quot;active_support\/time&quot;\r\n\r\ntime = Time.now\r\nputs time.yesterday &lt; time  # true\r\nputs time &lt; time.tomorrow   # true<\/pre>\n<p>\u672a\u6765\u306e\u65b9\u304c\u5927\u304d\u306a\u5024\u3067\u3042\u308b\u3068\u3044\u3048\u307e\u3059\u3002DateTime\u3067\u3082\u65e5\u4ed8\u306e\u6bd4\u8f03\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u8a73\u3057\u304f\u306f\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n            <a href=\"https:\/\/www.sejuku.net\/blog\/20215\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2016\/11\/ruby-150x86.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">Ruby\u3067\u65e5\u4ed8\u30fb\u6642\u523b\u3092\u6271\u3046\u306a\u3089Time\u30af\u30e9\u30b9\u306b\u6c7a\u307e\u308a\uff01<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n<h3>strftime\u3067format\u3092\u6574\u3048\u308b<\/h3>\n<p>ruby\u3067\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\uff08format\uff09\u3092\u6574\u3048\u308b\u306b\u306fstrftime\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">require &quot;date&quot;\r\ndatetime = Time.new(2017, 2,5, 8, 9, 30)\r\np datetime.strftime('%Y-%m-%d %H:%M:%S')       # \"2017-02-05 08:09:30\"\r\np datetime.strftime('%Y\u5e74%m\u6708%d\u65e5 %H\u6642%M\u5206%S\u79d2') # \"2017\u5e7402\u670805\u65e5 08\u664209\u520630\u79d2\"\r\np datetime.strftime('%Y\/%m\/%d %H:%M:%S')       # \"2017\/02\/05 08:09:30\"\r\np datetime.strftime('%F %T')                   # \"2017-02-05 08:09:30\"\r\n<\/pre>\n<ul>\n<li>\u5e74\u3092\u53d6\u308a\u51fa\u3059\u306b\u306f%Y<\/li>\n<li>\u6708\u3092\u53d6\u308a\u51fa\u3059\u306b\u306f%m<\/li>\n<li>\u65e5\u3092\u53d6\u308a\u51fa\u3059\u306b\u306f%d<\/li>\n<li>\u6642\u3092\u53d6\u308a\u51fa\u3059\u306b\u306f%H<\/li>\n<li>\u5206\u3092\u53d6\u308a\u51fa\u3059\u306b\u306f%M<\/li>\n<li>\u79d2\u3092\u53d6\u308a\u51fa\u3059\u306b\u306f%S<\/li>\n<\/ul>\n<p>\u5c0f\u6587\u5b57\u306e%m\u306f\u6708\u3067\u3001\u5927\u6587\u5b57\u306e%M\u306f\u5206\u3092\u8868\u3059\u306e\u3067\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002\u307e\u305f\u3001\u305d\u308c\u305e\u308c\u306e\u5b9f\u884c\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>%F = %Y-%m-%d<\/li>\n<li>%T = %H:%M:%S<\/li>\n<\/ul>\n<p>\u6700\u4f4e\u9650\u3053\u306e\u53d6\u308a\u51fa\u3057\u65b9\u304c\u5206\u304b\u3063\u3066\u3044\u308c\u3070\u3001\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3057\u3066\u8aad\u307f\u3084\u3059\u3044\u3088\u3046\u306b\u5909\u63db\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>strptime\u3067format\u3055\u308c\u305f\u6642\u9593\u3092\u5143\u306b\u623b\u3059<\/h3>\n<p>\u3055\u304d\u307b\u3069\u306fstrftime\u30e1\u30bd\u30c3\u30c9\u3067\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3057\u307e\u3057\u305f\u304c\u3001\u305d\u306e\u9006\u3067\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u304b\u3089Time\u306b\u623b\u3059\u306b\u306fstrptime\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u306fstrftime\u30e1\u30bd\u30c3\u30c9\u3067\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6307\u5b9a\u3057\u305f\u3082\u306e\u3092\u518d\u3073strptime\u30e1\u30bd\u30c3\u30c9\u3067\u3082\u3068\u306eTime\u306b\u623b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">require 'time'\r\n\r\ndatetime = Time.new(2017, 2,5, 8, 9, 30)\r\ndatetime_strf = datetime.strftime('%Y-%m-%d %H:%M:%S')\r\np datetime    # 2017-02-05 08:09:30 +0900\r\np datetime_strf # \"2017-02-05 08:09:30\"\r\np Time.strptime(datetime_strf,'%Y-%m-%d %H:%M:%S') # 2017-02-05 08:09:30 +0900\r\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001strptime\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3048\u3070\u3001strftime\u30e1\u30bd\u30c3\u30c9\u3067\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3092\u6574\u3048\u305f\u6642\u9593\u3092\u307e\u305fruby\u306e\u30af\u30e9\u30b9\u3067\u6271\u3048\u308b\u6642\u9593\u306b\u5909\u63db\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>strptime\u3067\u65e5\u672c\u8a9e\u3067format\u3055\u308c\u305f\u6642\u9593\u3092\u5143\u306b\u623b\u3059<\/h3>\n<p>Time\u30af\u30e9\u30b9\u306estrptime\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u3001\u65e5\u672c\u8a9e\u3067\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3055\u308c\u305f\u6642\u9593\u306e\u6587\u5b57\u5217\u3082\u3001\u5143\u306eTime\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u623b\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u306a\u304a\u3001\u6708\u3084\u65e5\u306e\u524d\u306b\u30b9\u30da\u30fc\u30b9\u304c\u7a7a\u3044\u3066\u3044\u308b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u6587\u5b57\u5217\u3092\u5143\u306b\u623b\u3059\u306b\u306f\u3001%m\u3084%d\u306e\u524d\u306b\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u7f6e\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u6708\u3084\u65e5\u306e\u524d\u306b\u30b9\u30da\u30fc\u30b9\u304c\u7a7a\u3044\u3066\u3044\u3066\u3082\u3001\u7a7a\u3044\u3066\u3044\u306a\u304f\u3066\u3082\u3001\u6b63\u3057\u304fe\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u623b\u305b\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">require 'time'\r\n\r\np Time.strptime(&quot;2020\u5e7404\u670801\u65e5 01:20:30&quot;,&quot;%Y\u5e74%m\u6708%d\u65e5 %H:%M:%S&quot;)\r\n# 2020-04-01 01:20:30 +0900\r\n\r\np Time.strptime(&quot;2020\u5e74 2\u6708 3\u65e5  8: 5: 0&quot;,&quot; %Y\u5e74 %m\u6708 %d\u65e5 %H: %M: %S&quot;)\r\n# 2020-02-03 08:05:00 +0900\r\n<\/pre>\n<p>\u4ee5\u4e0a\u306e\u3088\u3046\u306b\u3001strptime\u306e\u7b2c2\u306b\u5f15\u6570\u306b\u5e74\u30fb\u6708\u30fb\u65e5\u306a\u3069\u65e5\u672c\u8a9e\u306e\u6587\u5b57\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u65e5\u672c\u8a9e\u3067\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3055\u308c\u305f\u6642\u9593\u306e\u6587\u5b57\u5217\u304b\u3089\u3001Time\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>unix\u6642\u9593\u3092\u6271\u3046\u65b9\u6cd5<\/h3>\n<p>Time\u3092unix\u6642\u9593\u306b\u5909\u63db\u3059\u308b\u306b\u306fto_i\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3060\u3051\u3067\u3059\u3002\u307e\u305f\u3001unix\u6642\u9593\u304b\u3089\u9006\u306bTime\u3092\u5f97\u308b\u306b\u306fat\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">\r\ndatetime = Time.new(2017, 2,5, 8, 9, 30)\r\nunixtime = datetime.to_i\r\np datetime          # 2017-02-05 08:09:30 +0900\r\np unixtime          # 1486249770\r\np Time.at(unixtime) # 2017-02-05 08:09:30 +0900\r\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u4f5c\u6210\u3057\u305funix\u6642\u9593\u304b\u3089\u518d\u3073Time\u306b\u623b\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u4eca\u56de\u306fRuby\u3067\u65e5\u4ed8\u3092\u6271\u3046\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>Ruby\u3067\u306fTime\u30af\u30e9\u30b9\u3067\u65e5\u4ed8\u3092\u6271\u3046\u3053\u3068\u304c\u307b\u3068\u3093\u3069\u3067\u3001active_support\u3068\u3044\u3046gem\u3092\u5165\u308c\u308b\u3053\u3068\u3067\u3001Time\u30af\u30e9\u30b9\u3092\u3088\u308a\u4f7f\u3044\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Ruby\u3092\u52c9\u5f37\u3059\u308b\u65b9\u306fRails\u3092\u4f7f\u3046\u3053\u3068\u3082\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001Rails\u3067\u306f\u3053\u306eactive_support\u3068\u3044\u3046gem\u306f\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u8ffd\u52a0\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u5b66\u7fd2\u306e\u30dd\u30a4\u30f3\u30c8\u3092\u632f\u308a\u8fd4\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div style=\"padding: 10px 5px 10px 20px; margin-bottom: 20px; border: 3px solid #ffe4e2;\">\n\u30fbDate\u30af\u30e9\u30b9\u306f\u65e5\u4ed8\u3092\u6271\u3048\u308b\u3002\u6642\u9593\u306f\u6271\u3048\u306a\u3044\u3002<br \/>\n\u30fbDateTime\u30af\u30e9\u30b9\u306f\u65e5\u4ed8\u3001\u6642\u9593\u3092\u5171\u306b\u6271\u3048\u308b\u3002<br \/>\n\u30fbTime\u30af\u30e9\u30b9\u306f\u65e5\u4ed8\u3001\u6642\u9593\u3092\u5171\u306b\u6271\u3048\u308b\u3002Ruby\u3067\u65e5\u4ed8\u3001\u6642\u9593\u3092\u6271\u3046\u3068\u304d\u306f\u3001\u901a\u5e38Time\u30af\u30e9\u30b9\u3092\u6271\u3046\u3002<br \/>\n\u30fbTime\u30af\u30e9\u30b9\u3092\u6271\u3046\u6642\u306f\u3001\u901a\u5e38Rails\u306eActiveSupport\u3082\u4f7f\u7528\u3059\u308b\u3002<br \/>\n\u30fbTime\u30af\u30e9\u30b9\u3067\u65e5\u4ed8\u3001\u6642\u9593\u306e\u6bd4\u8f03\u304c\u3067\u304d\u308b\u3002<br \/>\n\u30fbstrftime\u3067\u3001\u65e5\u4ed8\u3001\u6642\u9593\u3092\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3055\u308c\u305f\u6587\u5b57\u5217\u3068\u3057\u3066\u6587\u5b57\u5217\u5316\u3067\u304d\u308b\u3002<br \/>\n\u30fbstrptime\u3067\u3001\u65e5\u4ed8\u3001\u6642\u9593\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3055\u308c\u305f\u6587\u5b57\u5217\u304b\u3089Time\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u623b\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u65e5\u672c\u8a9e\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3082\u53ef\u80fd\u3002<br \/>\n\u30fbTime\u30af\u30e9\u30b9\u3068unix\u6642\u9593\u3092\u3001to_i\u30e1\u30bd\u30c3\u30c9\u3068at\u30e1\u30bd\u30c3\u30c9\u3067\u76f8\u4e92\u5909\u63db\u3067\u304d\u308b\u3002\n<\/div>\n<p>\u3053\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u662f\u975e\u4f7f\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ruby\u3067\u65e5\u4ed8\u306e\u6271\u3044\u65b9\u304c\u308f\u304b\u3089\u306a\u3044 \u65e5\u4ed8\u3092\u6271\u3046\u30af\u30e9\u30b9\u304c\u591a\u3059\u304e\u3066\u3069\u308c\u3092\u4f7f\u3048\u3070\u826f\u3044\u304b\u308f\u304b\u3089\u306a\u3044 \u65e5\u4ed8\u306e\u8a08\u7b97\u65b9\u6cd5\u304c\u308f\u304b\u3089\u306a\u3044 \u65e5\u4ed8\u3084\u6642\u523b\u306e\u64cd\u4f5c\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3059\u308b\u4e0a\u3067\u5fc5\u9808\u306e\u77e5\u8b58\u306b\u306a\u3063\u3066\u304d\u307e\u3059\u3002\u3057\u304b\u3057Ruby\u3067\u65e5\u4ed8\u3084\u6642\u523b\u3092\u6271\u3046 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":101981,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"swell_btn_cv_data":"","footnotes":""},"categories":[2352],"tags":[114,68],"class_list":["post-13512","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ruby-study","tag-ruby","tag-68"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0<\/title>\n<meta name=\"description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sejuku.net\/blog\/13512\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"og:description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sejuku.net\/blog\/13512\" \/>\n<meta property=\"og:site_name\" content=\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sejuku2013\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/sejuku2013\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-04T06:59:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-06T02:40:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/01\/ruby_date.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"810\" \/>\n\t<meta property=\"og:image:height\" content=\"460\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/samuraijuku\" \/>\n<meta name=\"twitter:site\" content=\"@samuraijuku\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512\"},\"author\":{\"name\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/e8ca7fd09857a736a25e6b4455a3ab61\"},\"headline\":\"\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09\",\"datePublished\":\"2017-01-04T06:59:02+00:00\",\"dateModified\":\"2024-05-06T02:40:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512\"},\"wordCount\":169,\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/ruby_date.jpg\",\"keywords\":[\"ruby\",\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\"],\"articleSection\":[\"Ruby\u5b66\u7fd2\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512\",\"name\":\"\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/ruby_date.jpg\",\"datePublished\":\"2017-01-04T06:59:02+00:00\",\"dateModified\":\"2024-05-06T02:40:00+00:00\",\"description\":\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512#primaryimage\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/ruby_date.jpg\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/ruby_date.jpg\",\"width\":810,\"height\":460},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/13512#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"name\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"description\":\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\",\"name\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"width\":600,\"height\":600,\"caption\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/sejuku2013\",\"https:\\\/\\\/x.com\\\/samuraijuku\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCCFOQO5aDK0xXam4cUQXT8g\\\/featured\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/e8ca7fd09857a736a25e6b4455a3ab61\",\"name\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g\",\"caption\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8\"},\"description\":\"\u3010\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3011 DX\u8a8d\u5b9a\u53d6\u5f97\u4e8b\u696d\u8005\u306b\u9078\u5b9a\u3055\u308c\u3066\u3044\u308b\u682a\u5f0f\u4f1a\u793eSAMURAI\u306e\u30de\u30fc\u30b1\u30c6\u30a3\u30f3\u30b0\u30fb\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u90e8\u304c\u904b\u55b6\u3002\u300c\u8cea\u306e\u9ad8\u3044IT\u6559\u80b2\u3092\u3001\u3059\u3079\u3066\u306e\u4eba\u306b\u300d\u3092\u30df\u30c3\u30b7\u30e7\u30f3\u306b\u3001IT\u30fb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u5b66\u3073\u59cb\u3081\u305f\u521d\u5b66\u8005\u306e\u65b9\u306b\u5411\u3051\u8a18\u4e8b\u3092\u57f7\u7b46\u3002 \u7d2f\u8a08\u6307\u5c0e\u8005\u65704\u4e075,000\u540d\u4ee5\u4e0a\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u300c\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u300d\u3001\u7d2f\u8a08\u767b\u9332\u8005\u65701\u4e078,000\u4eba\u4ee5\u4e0a\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u5b66\u7fd2\u30b5\u30fc\u30d3\u30b9\u300c\u4f8d\u30c6\u30e9\u30b3\u30e4\u300d\u3067\u6271\u3046\u6559\u6750\u958b\u767a\u306e\u30ce\u30a6\u30cf\u30a6\u30012013\u5e74\u306e\u5275\u696d\u304b\u3089\u904b\u55b6\u3067\u5f97\u305f\u77e5\u898b\u306b\u57fa\u3065\u304d\u3001\u8a18\u4e8b\u306e\u57f7\u7b46\u3060\u3051\u3067\u306a\u304f\u7de8\u96c6\u30fb\u76e3\u4fee\u3082\u62c5\u5f53\u3057\u3066\u3044\u307e\u3059\u3002 \u3010\u5c02\u9580\u5206\u91ce\u3011 IT\\\/Web\u958b\u767a\\\/AI\u30fb\u30ed\u30dc\u30c3\u30c8\u958b\u767a\\\/\u30a4\u30f3\u30d5\u30e9\u958b\u767a\\\/\u30b2\u30fc\u30e0\u958b\u767a\\\/AI\\\/Web\u30c7\u30b6\u30a4\u30f3\",\"sameAs\":[\"https:\\\/\\\/www.sejuku.net\\\/\",\"https:\\\/\\\/www.facebook.com\\\/sejuku2013\\\/\",\"https:\\\/\\\/www.instagram.com\\\/samuraiengineer_official\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/samuraijuku\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCCFOQO5aDK0xXam4cUQXT8g\"],\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/author\\\/samurai-blog\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sejuku.net\/blog\/13512","og_locale":"ja_JP","og_type":"article","og_title":"\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","og_description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","og_url":"https:\/\/www.sejuku.net\/blog\/13512","og_site_name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","article_publisher":"https:\/\/www.facebook.com\/sejuku2013","article_author":"https:\/\/www.facebook.com\/sejuku2013\/","article_published_time":"2017-01-04T06:59:02+00:00","article_modified_time":"2024-05-06T02:40:00+00:00","og_image":[{"width":810,"height":460,"url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/01\/ruby_date.jpg","type":"image\/jpeg"}],"author":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/samuraijuku","twitter_site":"@samuraijuku","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sejuku.net\/blog\/13512#article","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/13512"},"author":{"name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/e8ca7fd09857a736a25e6b4455a3ab61"},"headline":"\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09","datePublished":"2017-01-04T06:59:02+00:00","dateModified":"2024-05-06T02:40:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/13512"},"wordCount":169,"publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/13512#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/01\/ruby_date.jpg","keywords":["ruby","\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"],"articleSection":["Ruby\u5b66\u7fd2"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.sejuku.net\/blog\/13512","url":"https:\/\/www.sejuku.net\/blog\/13512","name":"\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/13512#primaryimage"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/13512#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/01\/ruby_date.jpg","datePublished":"2017-01-04T06:59:02+00:00","dateModified":"2024-05-06T02:40:00+00:00","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","breadcrumb":{"@id":"https:\/\/www.sejuku.net\/blog\/13512#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sejuku.net\/blog\/13512"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/13512#primaryimage","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/01\/ruby_date.jpg","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/01\/ruby_date.jpg","width":810,"height":460},{"@type":"BreadcrumbList","@id":"https:\/\/www.sejuku.net\/blog\/13512#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sejuku.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u3010Ruby\u5165\u9580\u3011\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u6271\u3044\u65b9\uff08Date\u3001DateTime\u3001Time\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.sejuku.net\/blog\/#website","url":"https:\/\/www.sejuku.net\/blog\/","name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002","publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sejuku.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.sejuku.net\/blog\/#organization","name":"\u682a\u5f0f\u4f1a\u793eSAMURAI","url":"https:\/\/www.sejuku.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","width":600,"height":600,"caption":"\u682a\u5f0f\u4f1a\u793eSAMURAI"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/sejuku2013","https:\/\/x.com\/samuraijuku","https:\/\/www.youtube.com\/channel\/UCCFOQO5aDK0xXam4cUQXT8g\/featured"]},{"@type":"Person","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/e8ca7fd09857a736a25e6b4455a3ab61","name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g","caption":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8"},"description":"\u3010\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3011 DX\u8a8d\u5b9a\u53d6\u5f97\u4e8b\u696d\u8005\u306b\u9078\u5b9a\u3055\u308c\u3066\u3044\u308b\u682a\u5f0f\u4f1a\u793eSAMURAI\u306e\u30de\u30fc\u30b1\u30c6\u30a3\u30f3\u30b0\u30fb\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u90e8\u304c\u904b\u55b6\u3002\u300c\u8cea\u306e\u9ad8\u3044IT\u6559\u80b2\u3092\u3001\u3059\u3079\u3066\u306e\u4eba\u306b\u300d\u3092\u30df\u30c3\u30b7\u30e7\u30f3\u306b\u3001IT\u30fb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u5b66\u3073\u59cb\u3081\u305f\u521d\u5b66\u8005\u306e\u65b9\u306b\u5411\u3051\u8a18\u4e8b\u3092\u57f7\u7b46\u3002 \u7d2f\u8a08\u6307\u5c0e\u8005\u65704\u4e075,000\u540d\u4ee5\u4e0a\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u300c\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u300d\u3001\u7d2f\u8a08\u767b\u9332\u8005\u65701\u4e078,000\u4eba\u4ee5\u4e0a\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u5b66\u7fd2\u30b5\u30fc\u30d3\u30b9\u300c\u4f8d\u30c6\u30e9\u30b3\u30e4\u300d\u3067\u6271\u3046\u6559\u6750\u958b\u767a\u306e\u30ce\u30a6\u30cf\u30a6\u30012013\u5e74\u306e\u5275\u696d\u304b\u3089\u904b\u55b6\u3067\u5f97\u305f\u77e5\u898b\u306b\u57fa\u3065\u304d\u3001\u8a18\u4e8b\u306e\u57f7\u7b46\u3060\u3051\u3067\u306a\u304f\u7de8\u96c6\u30fb\u76e3\u4fee\u3082\u62c5\u5f53\u3057\u3066\u3044\u307e\u3059\u3002 \u3010\u5c02\u9580\u5206\u91ce\u3011 IT\/Web\u958b\u767a\/AI\u30fb\u30ed\u30dc\u30c3\u30c8\u958b\u767a\/\u30a4\u30f3\u30d5\u30e9\u958b\u767a\/\u30b2\u30fc\u30e0\u958b\u767a\/AI\/Web\u30c7\u30b6\u30a4\u30f3","sameAs":["https:\/\/www.sejuku.net\/","https:\/\/www.facebook.com\/sejuku2013\/","https:\/\/www.instagram.com\/samuraiengineer_official\/","https:\/\/x.com\/https:\/\/twitter.com\/samuraijuku","https:\/\/www.youtube.com\/channel\/UCCFOQO5aDK0xXam4cUQXT8g"],"url":"https:\/\/www.sejuku.net\/blog\/author\/samurai-blog"}]}},"_links":{"self":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/13512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/comments?post=13512"}],"version-history":[{"count":0,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/13512\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media\/101981"}],"wp:attachment":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media?parent=13512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/categories?post=13512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/tags?post=13512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}