How to use the rfc3339.rfc3339.strtotimestamp function in rfc3339

To help you get started, we’ve selected a few rfc3339 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brvier / KhtNotes / khtnotes / importer.py View on Github external
if os.path.exists(path + '.txt'):
                    index = 2
                    while (os.path.exists(os.path.join(
                            note.NOTESPATH, '%s %s.txt'
                            % (path,
                                unicode(index))))):
                        index = index + 1
                    uuid = ('%s %s'
                            % (os.path.basename(path),
                            unicode(index)))

                note.uuid = uuid + '.txt'
                note.write(handler._content)
                try:
                    from rfc3339.rfc3339 import strtotimestamp
                    mtime = strtotimestamp(handler._last_change)
                    lpath = os.path.join(Note.NOTESPATH, note.uuid)
                    os.utime(lpath, (-1, mtime))
                except Exception:
                    import traceback
                    print traceback.format_exc()

            except Exception:
                import traceback
                print traceback.format_exc()

        self._set_running(False)
        self.on_finished.emit()

rfc3339

Format dates according to the RFC 3339.

ISC
Latest version published 5 years ago

Package Health Score

49 / 100
Full package analysis