{"id":209,"date":"2013-04-17T12:41:34","date_gmt":"2013-04-17T03:41:34","guid":{"rendered":"https:\/\/www.united-bears.co.jp\/blog\/?p=209"},"modified":"2013-04-17T12:41:34","modified_gmt":"2013-04-17T03:41:34","slug":"simpledateforamt-%e3%81%8c%e9%81%85%e3%81%84","status":"publish","type":"post","link":"https:\/\/www.united-bears.co.jp\/blog\/archives\/209","title":{"rendered":"SimpleDateForamt \u304c\u9045\u3044"},"content":{"rendered":"<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u3092\u9032\u3081\u3066\u3044\u304f\u3046\u3061\u306b\u3001\u52d5\u4f5c\u304c\u9045\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u306f\u3088\u304f\u3042\u308b\u3002\u3057\u304b\u3057\u3001\u591a\u304f\u306e\u5834\u5408\u3001\u4f55\u304c\u9045\u304f\u306a\u3063\u305f\u539f\u56e0\u306a\u306e\u304b\u306f\u3063\u304d\u308a\u3057\u306a\u3044\u3002\u4eca\u56de\u9045\u304f\u306a\u3063\u305f\u306e\u306f\u3001\u521d\u671f\u753b\u9762\u306e\u8868\u793a\u3002\u884c\u3063\u3066\u3044\u308b\u306e\u306f\u3001SurfaceView \u306e Canvas \u306b\u7dda\u3092\u5f15\u3044\u3066\u3001\u65e5\u4ed8\u3068\u753b\u50cf\u3092\u8cbc\u308a\u4ed8\u3051\u3066\u3044\u308b\u3060\u3051\u3002\u4e00\u90e8\u3001\u30b0\u30e9\u30c7\u30fc\u30b7\u30e7\u30f3\u306a\u3069\u3082\u884c\u3063\u3066\u3044\u308b\u304c\u3001\u305f\u3044\u3057\u305f\u51e6\u7406\u3067\u306f\u306a\u3044\u3002\u7dda\u3092\u5f15\u3044\u305f\u3060\u3051\u306e\u6642\u306f\u4e00\u77ac\u3067\u52d5\u4f5c\u3057\u305f\u306e\u306b\u3001\u65e5\u4ed8\u3084\u753b\u50cf\u3092\u63cf\u753b\u3057\u305f\u3089\u30011\u79d2\u5f31\u304b\u304b\u3063\u3066\u3057\u307e\u3046\u3088\u3046\u306b\u306a\u3063\u305f\u3002\u9045\u304f\u306a\u3063\u305f\u539f\u56e0\u3092\u63a8\u6e2c\u3059\u308b\u3068\u30fb\u30fb\u30fb<\/p>\n<ol>\n<li>\u30a2\u30f3\u30c1\u30a8\u30a4\u30ea\u30a2\u30b9\u3092\u304b\u3051\u3066\u3044\u308b<\/li>\n<li>\u63cf\u753b\u3059\u308b\u969b\u306b\u72ec\u81ea\u306e\u30af\u30e9\u30b9\u3092\u4f55\u56de\u3082 new \u3057\u3066\u3044\u308b<\/li>\n<li>\u63cf\u753b\u4f4d\u7f6e\u306e\u8a08\u7b97\u304c\u9045\u3044<\/li>\n<\/ol>\n<p>\u306a\u3069\u3060(\u305a\u3044\u3076\u3093\u60aa\u3044\u3053\u3068\u3070\u304b\u308a\u3057\u3066\u308b\u306a\u3093\u3066\u8a00\u308f\u306a\u3044\u3067\u304f\u3060\u3055\u3044)\u3002\u305d\u308c\u305e\u308c\u3001<\/p>\n<pre>long l = System.currentTimeMillis();\r\n...\r\nSystem.err.println((System.currentTimeMillis() - l));<\/pre>\n<p>\u3067\u306f\u3055\u3093\u3067\u6642\u9593\u3092\u8a08\u6e2c\u3057\u3066\u307f\u305f\u3002\u3069\u3046\u3082\u6570\u5b57\u3092\u63cf\u753b\u3057\u3066\u3044\u308b\u7b87\u6240\u304c\u9045\u3044\u3002\u30a2\u30f3\u30c1\u30a8\u30a4\u30ea\u30a2\u30b9\u3092\u5916\u3057\u3066\u307f\u305f\u304c\u3001\u6642\u9593\u306f\u304b\u308f\u3089\u306a\u304b\u3063\u305f\u3002\u6570\u5b57\u3092\u63cf\u753b\u3059\u308b\u7b87\u6240\u306e1\u3064\u305a\u3064\u306e\u51e6\u7406\u306e\u6642\u9593\u3092\u8a08\u6e2c\u3057\u3066\u307f\u308b\u3068\u3001SimpleDateForamt \u3092 new \u3057\u3066\u3044\u308b\u7b87\u6240\u304c\u9045\u3044\u3002<\/p>\n<p>\u305f\u3057\u304b\u306b\u3001String.format() \u7cfb\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u30b3\u30b9\u30c8\u304c\u9ad8\u3044\u3002Android \u306b\u306f\u3001android.text.format.DateFormat \u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001Java \u6a19\u6e96\u306e SimpleDateFormat\u3001Android \u306e DateFormat\u3001\u5358\u7d14\u306b Calendar \u304b\u3089\u65e5\u4ed8\u3092\u53d6\u5f97\u3059\u308b3\u3064\u306e\u65b9\u6cd5\u3092\u6bd4\u8f03\u3057\u3066\u307f\u305f\u3002<\/p>\n<h5>\u6a19\u6e96\u306e SimpleDateFormat \u3092\u4f7f\u3046<\/h5>\n<p>\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u30fc\u4e0a\u3067\u3001\u7d049ms\u304b\u304b\u308b\u3002<\/p>\n<pre>\r\nnew SimpleDateFormat(\"d\",Locale.JAPAN).format(date);\r\n<\/pre>\n<h5>android.text.format.DateFormat \u3092\u4f7f\u3046<\/h5>\n<p>\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u30fc\u4e0a\u3067\u3001\u7d045ms\u304b\u304b\u308b\u3002<\/p>\n<pre>\r\nCharSequence s = DateFormat.format(\"d\", System.currentTimeMillis());\r\ns.toString();\r\n<\/pre>\n<h5>Calendar \u304b\u3089\u53d6\u5f97<\/h5>\n<p>\u30a8\u30df\u30e5\u30ec\u30fc\u30bf\u30fc\u4e0a\u3067\u3001\u7d042ms\u304b\u304b\u308b\u3002<\/p>\n<pre>\r\nCalendar c = Calendar.getInstance();\r\nc.setTimeInMillis(System.currentTimeMillis());\r\nc.get(Calendar.DAY_OF_MONTH);\r\n<\/pre>\n<p>\u65e5\u4ed8\u3092\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3059\u308b\u51e6\u7406\u306f\u3001\u7d04100\u56de\u884c\u3063\u3066\u3044\u308b\u3002\u4e00\u56de\u306e\u51e6\u7406\u304c1\/5\u306b\u306a\u308c\u3070\u4f53\u611f\u901f\u5ea6\u306f\u76f8\u5f53\u4e0a\u304c\u308b\u306f\u305a\u3002\u4eca\u56de\u306f\u8907\u96d1\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306f\u4e0d\u8981\u306a\u306e\u3067\u3001Calendar \u304b\u3089\u53d6\u5f97\u3057\u305f\u5024\u3092\u4f7f\u3063\u3066\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u3092\u9032\u3081\u3066\u3044\u304f\u3046\u3061\u306b\u3001\u52d5\u4f5c\u304c\u9045\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u306f\u3088\u304f\u3042\u308b\u3002\u3057\u304b\u3057\u3001\u591a\u304f\u306e\u5834\u5408\u3001\u4f55\u304c\u9045\u304f\u306a\u3063\u305f\u539f\u56e0\u306a\u306e\u304b\u306f\u3063\u304d\u308a\u3057\u306a\u3044\u3002\u4eca\u56de\u9045\u304f\u306a\u3063\u305f\u306e\u306f\u3001\u521d\u671f\u753b\u9762\u306e\u8868\u793a\u3002\u884c\u3063\u3066\u3044\u308b\u306e\u306f\u3001SurfaceView \u306e  [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-android","category-android-develop"],"_links":{"self":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":8,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":217,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/209\/revisions\/217"}],"wp:attachment":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}