diff options
Diffstat (limited to 'fatfs/documents/doc/fattime.html')
-rw-r--r-- | fatfs/documents/doc/fattime.html | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/fatfs/documents/doc/fattime.html b/fatfs/documents/doc/fattime.html index dfc4937..002733a 100644 --- a/fatfs/documents/doc/fattime.html +++ b/fatfs/documents/doc/fattime.html @@ -48,7 +48,30 @@ DWORD get_fattime (void); <div class="para comp">
<h4>QuickInfo</h4>
-<p>This function is not needed when <tt>FF_FS_READONLY == 1</tt> or <tt>FF_FS_NORTC == 1</tt>.</p>
+<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>
+</div>
+
+
+<div class="para use">
+<h4>Example</h4>
+<pre>
+DWORD get_fattime (void)
+{
+ time_t t;
+ struct tm *stm;
+
+
+ t = time(0);
+ stm = localtime(&t);
+
+ return (DWORD)(stm->tm_year - 80) << 25 |
+ (DWORD)(stm->tm_mon + 1) << 21 |
+ (DWORD)stm->tm_mday << 16 |
+ (DWORD)stm->tm_hour << 11 |
+ (DWORD)stm->tm_min << 5 |
+ (DWORD)stm->tm_sec >> 1;
+}
+</pre>
</div>
|