1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
5 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
6 <link rel=
"up" title=
"FatFs" href=
"../00index_e.html">
7 <link rel=
"alternate" hreflang=
"ja" title=
"Japanese" href=
"../ja/fattime.html">
8 <link rel=
"stylesheet" href=
"../css_e.css" type=
"text/css" media=
"screen" title=
"ELM Default">
9 <title>FatFs - get_fattime
</title>
14 <div class=
"para func">
16 <p>The get_fattime function is called to get the current time.
</p>
18 DWORD get_fattime (void);
23 <div class=
"para ret">
25 <p>Currnet local time shall be returned as bit-fields packed into a
<tt>DWORD
</tt> value. The bit fields are as follows:
</p>
28 <dd>Year origin from the
1980 (
0.
.127, e.g.
37 for
2017)
</dd>
30 <dd>Month (
1.
.12)
</dd>
32 <dd>Day of the month (
1.
.31)
</dd>
36 <dd>Minute (
0.
.59)
</dd>
38 <dd>Second /
2 (
0.
.29, e.g.
25 for
50)
</dd>
43 <div class=
"para desc">
45 <p>The
<tt>get_fattime
</tt> function shall return any valid time even if the system does not support a real time clock. If a zero is returned, the file will not have a valid timestamp.
</p>
49 <div class=
"para comp">
51 <p>This function is not needed when
<tt><a href=
"config.html#fs_readonly">FF_FS_READONLY
</a> ==
1</tt> or
<tt><a href=
"config.html#fs_nortc">FF_FS_NORTC
</a> ==
1</tt>.
</p>
55 <div class=
"para use">
58 DWORD get_fattime (void)
67 return (DWORD)(stm-
>tm_year -
80)
<< 25 |
68 (DWORD)(stm-
>tm_mon +
1)
<< 21 |
69 (DWORD)stm-
>tm_mday
<< 16 |
70 (DWORD)stm-
>tm_hour
<< 11 |
71 (DWORD)stm-
>tm_min
<< 5 |
72 (DWORD)stm-
>tm_sec
>> 1;
78 <p class=
"foot"><a href=
"../00index_e.html">Return
</a></p>