简体   繁体   中英

In iOS lastModifiedDate using phone gap is not working

I'm doing an iOS app using phonegap, in that in need lastModified date for my processing. When in use the function,it returns me the device date(current/today's date)

code i used for your reference

<script>
    function handleFileSelect(evt) {
        var files = evt.target.files; 
        var output = [];
        for (var i = 0, f; f = files[i]; i++) {
         output.push('<li><strong>', escape(f.name), '</strong> (', f.type || 'n/a', ')- ',           
                        f.size, ' bytes, last modified: ',
                        f.lastModifiedDate ? f.lastModifiedDate.toLocaleDateString() : 'n/a',
                        '</li>');
        }
        document.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';
    }

        document.getElementById('files').addEventListener('change', handleFileSelect, false);
</script>

file.lastModifiedDate;

  • it Returns the last modified date of the file.
  • Files without a known last modified date use the current date instead.
  • And it is not supported in Safari (WebKit)(iphone default web browser)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM