{"id":176,"date":"2012-06-28T13:09:51","date_gmt":"2012-06-28T04:09:51","guid":{"rendered":"http:\/\/soundengine.jp\/wordpress\/tips\/?p=176"},"modified":"2014-02-06T23:42:39","modified_gmt":"2014-02-06T14:42:39","slug":"c%e7%8f%be%e5%9c%a8%e3%81%ae%e6%99%82%e5%88%bb%e3%82%92%e6%96%87%e5%ad%97%e5%88%97%e3%81%ab","status":"publish","type":"post","link":"https:\/\/soundengine.jp\/wordpress\/tips\/tutorial\/176\/","title":{"rendered":"C++\u73fe\u5728\u306e\u6642\u523b\u3092\u6587\u5b57\u5217\u306b"},"content":{"rendered":"<p>C++\u3067\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u3001\u73fe\u5728\u306e\u6642\u523b\u3092\u6587\u5b57\u5217\u306b\u3057\u305f\u3044\u6642\u304c\u3042\u308b\u3002\u305d\u306e\u4e00\u65b9\u6cd5\u3092\u7c21\u5358\u306b\u7d39\u4ecb\u3002<\/p>\n<p><!--more--><\/p>\n<h2 id=\"content_1_0\">\u6642\u523b\u53d6\u5f97  <a class=\"anchor_super\" id=\"k9ea7586\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-04-23#k9ea7586\" title=\"k9ea7586\"> <\/a><\/h2>\n<p>\u6b21\u306e\u3088\u3046\u306a\u5f62\u3067\u307e\u305a\u306f\u6642\u523b\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002__time64_t\u3092\u4f7f\u3046\u7406\u7531\u3068\u3057\u3066\u306f\u3001<a href=\"http:\/\/msdn2.microsoft.com\/ja-jp\/library\/w4ddyt9h%28VS.80%29.aspx\" rel=\"nofollow\">MSDN\u304b\u3089\u306e\u5f15\u7528<\/a>\u3092\u3059\u308b\u3068__time32_t\u3067\u306f<\/p>\n<blockquote>\n<p class=\"quotation\">UTC \u306e 2038 \u5e74 1 \u6708 19 \u65e5 03 \u6642 14 \u5206 07 \u79d2\u4ee5\u964d\u306e\u65e5\u4ed8\u306b\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093<\/p>\n<\/blockquote>\n<p>\u3068\u3044\u3046\u3053\u3068\u306b\u3088\u308b\u3002(Visual C++ 2005\u3067\u306f\u3001time_t\u306f__time64_t\u3068\u306e\u3053\u3068\u306a\u3093\u3067\u305d\u306e\u5fc3\u914d\u306f\u306a\u3044\u3068\u306e\u3053\u3068\uff09<\/p>\n<pre>\t__time64_t t1;\r\n\t_time64( &amp;t1 );\r\n\r\n\tstruct tm t2;\r\n\t_localtime64_s( &amp;t1, &amp;t2 );<\/pre>\n<p>\u306a\u304a\u30012003\u306a\u3069\u3067\u306f\u3001_s\u304c\u3064\u3044\u305f<a href=\"http:\/\/msdn2.microsoft.com\/ja-jp\/library\/wd3wzwts%28VS.80%29.aspx\" rel=\"nofollow\">CRT\u95a2\u6570\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u304c\u5f37\u5316\u3055\u308c\u305f\u30d0\u30fc\u30b8\u30e7\u30f3<\/a>\u304c\u4f7f\u3048\u306a\u3044\u306e\u3067\u4f8b\u3048\u3070\u3053\u3093\u306a\u611f\u3058\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre>\t__time64_t t1;\r\n\t_time64( &amp;t1 );\r\n\r\n\tstruct tm t2;\r\n\r\n#ifndef _CRT_SECURE_NO_DEPRECATE \r\n\t_localtime64_s( &amp;t1, &amp;t2 );\r\n#else\r\n\tt2 = *_localtime64( &amp;t1 );\r\n#endif<\/pre>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_1\">\u6587\u5b57\u5217\u5316  <a class=\"anchor_super\" id=\"aad79adc\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-04-23#aad79adc\" title=\"aad79adc\"> <\/a><\/h2>\n<p>C++\u3068\u3044\u3044\u3064\u3064\u3001\u4eca\u56de\u306fATL\u3084WTL\u3001MFC\u3067\u304a\u306a\u3058\u307f\u306eCString\u3092\u4f7f\u3063\u3066\u884c\u3046\u3002\uff08Windows Visual Studio\u3092\u4f7f\u3063\u3066\u3044\u306a\u3044\u4eba\u306b\u306f\u53c2\u8003\u306b\u306a\u3089\u306a\u3044\u304c\u3001\u3001\u3001sprintf\u3067\u3082\u4f55\u3067\u3082\u4f7f\u3063\u3066\u3082\u3089\u3048\u308c\u3070\uff09\u3053\u3053\u3067\u3001\u6ce8\u610f\u3068\u3057\u3066tm::tm_year\u306f1900\u5e74\u304b\u3089\u306e\u5dee\u5206\u5024\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u30671900\u8db3\u3059\u5fc5\u8981\u304c\u3042\u308b\u3002\u307e\u305f\u3001tm::tm_mon\u306f1\u6708\u304b\u3089\u306e\u5dee\u5206\u5024\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u30671\u8db3\u3059\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<pre>CString d;\r\nd.Format( _T( \"%04d\/%02d\/%02d\" ), t2.tm_year + 1900, t2.tm_mon + 1, t2.tm_mday );\r\nCString t;\r\nt.Format( _T( \"%02d:%02d:%02d\" ), t2.tm_hour, t2.tm_min, t2.tm_sec );<\/pre>\n<p>\u4ee5\u4e0a\u3067\u73fe\u5728\u6642\u523b(\u6642\u9593)\u3092\u6587\u5b57\u5217\u5316\u3067\u304d\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C++\u3067\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3057\u3066\u3044\u308b\u3068\u304d\u306b\u3001\u73fe\u5728\u306e\u6642\u523b\u3092\u6587\u5b57\u5217\u306b\u3057\u305f\u3044\u6642\u304c\u3042\u308b\u3002\u305d\u306e &hellip; <a href=\"https:\/\/soundengine.jp\/wordpress\/tips\/tutorial\/176\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-176","post","type-post","status-publish","format-standard","hentry","category-tutorial"],"_links":{"self":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/comments?post=176"}],"version-history":[{"count":4,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/176\/revisions"}],"predecessor-version":[{"id":3353,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/176\/revisions\/3353"}],"wp:attachment":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/media?parent=176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/categories?post=176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/tags?post=176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}