summaryrefslogtreecommitdiff
path: root/fatfs/documents/doc/fattime.html
diff options
context:
space:
mode:
Diffstat (limited to 'fatfs/documents/doc/fattime.html')
-rw-r--r--fatfs/documents/doc/fattime.html25
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) &lt;&lt; 25 |
+ (DWORD)(stm->tm_mon + 1) &lt;&lt; 21 |
+ (DWORD)stm->tm_mday &lt;&lt; 16 |
+ (DWORD)stm->tm_hour &lt;&lt; 11 |
+ (DWORD)stm->tm_min &lt;&lt; 5 |
+ (DWORD)stm->tm_sec &gt;&gt; 1;
+}
+</pre>
</div>