<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: FTP server file date in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/FTP-server-file-date/m-p/504972#M16201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the information Daniel.&lt;/P&gt;&lt;P&gt;While looking through the FTP / MFS code to see where I could place this I noticed that MFS already tries to write the date based on _time_get. Then it dawned on me that if I synchronised the systems tick with the real time it should all work. So I have now added the following to my start-up code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; //Synchronise systems clock to real time clock&lt;BR /&gt; rtc_datetime_t datetime;&lt;BR /&gt; RTC_DRV_GetDatetime( FSL_RTCTIMER1, &amp;amp;datetime );&lt;BR /&gt; DATE_STRUCT date;&lt;BR /&gt; TIME_STRUCT time;&lt;/P&gt;&lt;P&gt; date.YEAR = datetime.year;&lt;BR /&gt; date.MONTH = datetime.month;&lt;BR /&gt; date.DAY = datetime.day;&lt;BR /&gt; date.HOUR = datetime.hour;&lt;BR /&gt; date.SECOND = datetime.second;&lt;BR /&gt; date.MILLISEC = 0;&lt;BR /&gt; _time_from_date(&amp;amp;date, &amp;amp;time);&lt;BR /&gt; _time_set(&amp;amp;time);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if that is the most efficient way but it works and now the date/time of any files I create use the current real time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adrian.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jan 2016 09:40:07 GMT</pubDate>
    <dc:creator>adyr</dc:creator>
    <dc:date>2016-01-04T09:40:07Z</dc:date>
    <item>
      <title>FTP server file date</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/FTP-server-file-date/m-p/504970#M16199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using MQX with KSDK 1.3 and I have created an FTP server that is saving files to an SD card with MFS. It is working except the date / time of files written to the SD card via FTP are always 1/1/1970 (viewed in the FTP client). I have the RTC running with the correct time so is there a way to integrate it with the MFS / FTP server so the corrected date is written to the file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Adrian.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Dec 2015 14:19:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/FTP-server-file-date/m-p/504970#M16199</guid>
      <dc:creator>adyr</dc:creator>
      <dc:date>2015-12-24T14:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: FTP server file date</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/FTP-server-file-date/m-p/504971#M16200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adrian:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can try the IO_IOCTL_SET_DATE_TIME command, this command sets the time and date of an open file.&lt;/P&gt;&lt;P&gt;Please refer to the section 3.8.1.25 of MFS user guide for more details&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2965i495DC17FF51A5FCA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Dec 2015 02:49:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/FTP-server-file-date/m-p/504971#M16200</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2015-12-28T02:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: FTP server file date</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/FTP-server-file-date/m-p/504972#M16201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the information Daniel.&lt;/P&gt;&lt;P&gt;While looking through the FTP / MFS code to see where I could place this I noticed that MFS already tries to write the date based on _time_get. Then it dawned on me that if I synchronised the systems tick with the real time it should all work. So I have now added the following to my start-up code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; //Synchronise systems clock to real time clock&lt;BR /&gt; rtc_datetime_t datetime;&lt;BR /&gt; RTC_DRV_GetDatetime( FSL_RTCTIMER1, &amp;amp;datetime );&lt;BR /&gt; DATE_STRUCT date;&lt;BR /&gt; TIME_STRUCT time;&lt;/P&gt;&lt;P&gt; date.YEAR = datetime.year;&lt;BR /&gt; date.MONTH = datetime.month;&lt;BR /&gt; date.DAY = datetime.day;&lt;BR /&gt; date.HOUR = datetime.hour;&lt;BR /&gt; date.SECOND = datetime.second;&lt;BR /&gt; date.MILLISEC = 0;&lt;BR /&gt; _time_from_date(&amp;amp;date, &amp;amp;time);&lt;BR /&gt; _time_set(&amp;amp;time);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if that is the most efficient way but it works and now the date/time of any files I create use the current real time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adrian.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 09:40:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/FTP-server-file-date/m-p/504972#M16201</guid>
      <dc:creator>adyr</dc:creator>
      <dc:date>2016-01-04T09:40:07Z</dc:date>
    </item>
  </channel>
</rss>

