<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ktrito33</author_name>
  <author_url>https://blog.hatena.ne.jp/ktrito33/</author_url>
  <blog_title>怠日記</blog_title>
  <blog_url>https://nmk365.hatenablog.jp/</blog_url>
  <categories>
    <anon>C言語</anon>
  </categories>
  <description>C言語で現在の日時を取得するには次のようにする。 gettimeofday() でUNIX時間を取得 UNIX時間を localtime() で tm 構造体に変換 次のプログラムは現在の日時を yyyy/MM/dd HH:mm:ss.fff 形式で出力する。 #include &lt;stdio.h&gt; #include &lt;time.h&gt; #include &lt;sys/time.h&gt; void main() { /* UNIX時間を取得 */ struct timeval tv; if ( gettimeofday(&amp;tv, NULL) != 0 ) { printf(&quot;gettimeofday fa…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnmk365.hatenablog.jp%2Fentry%2Fclang-obtain-current-date-time&quot; title=&quot;C言語: 現在の日時を取得する(1) | gettimeofday(), localtime() - 怠日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-04-15 08:00:00</published>
  <title>C言語: 現在の日時を取得する(1) | gettimeofday(), localtime()</title>
  <type>rich</type>
  <url>https://nmk365.hatenablog.jp/entry/clang-obtain-current-date-time</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
