{"url":"https://secondlife.hatenablog.jp/entry/20050922/1127376501","blog_title":"2nd life (\u79fb\u8ee2\u3057\u307e\u3057\u305f)","published":"2005-09-22 17:08:21","image_url":null,"categories":[],"width":"100%","provider_url":"https://hatena.blog","type":"rich","provider_name":"Hatena Blog","title":"\u8a95\u751f\u65e5\u304b\u3089\u5e74\u9f62\u3092\u6c42\u3081\u308b","author_name":"secondlife","description":"\u8a95\u751f\u65e5(time\u30aa\u30d6\u30b8\u30a7\u30af\u30c8)\u304b\u3089\u5e74\u9f62\u3092\u6c42\u3081\u305f\u3044\u3068\u304d class Time def to_age now = Time.now.strftime(\"%Y%m%d\").to_i birthday = self.strftime(\"%Y%m%d\").to_i (now - birthday) / 10000 end end \u3068\u304b\u3044\u3046method\u3092\u4f5c\u3063\u3066\u304a\u304f\u3068 require 'time' t = Time.parse('1981/9/26') p t.to_age #=> 23 \u3068\u7c21\u5358\u306b\u6c42\u3081\u3089\u308c\u308b\uff01\u524d\u3069\u3063\u304b\u3067\u5358\u7d14\u306b\u73fe\u5728\u306e20050922\u307f\u305f\u3044\u306a\u65e5\u4ed8\u304b\u3089\u8a95\u751f\u65e5\u306e19810926\u3092\u5f15\u3044\u306610000\u3067\u5272\u2026","height":"190","version":"1.0","author_url":"https://blog.hatena.ne.jp/secondlife/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecondlife.hatenablog.jp%2Fentry%2F20050922%2F1127376501\" title=\"\u8a95\u751f\u65e5\u304b\u3089\u5e74\u9f62\u3092\u6c42\u3081\u308b - 2nd life (\u79fb\u8ee2\u3057\u307e\u3057\u305f)\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://secondlife.hatenablog.jp/"}