Community
    • Login

    Insert time only as hh:mm:ss

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 5.1k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ron ShawR Offline
      Ron Shaw
      last edited by

      I have a need to insert just the time as hh:mm:ss (no date or AM/PM) + a space or - at the start of a line to record the exact time when I entered the text, so I can sync it up with pictures I took at the same time.

      I have already tried to create a macro that inserts the short format Date & Time as 8:12 AM 2/9/2016 using TextFx Insert, and then back spacing to erase the date. But apparently the backspace code executes before the full date gets written, ending up with only 2-3 characters of the insert. Even if it worked I would only get hh:mm and not hh:mm:ss.
      By using 2 shortcut keys, one for time/date, the other for backspaces, I can at least get hh:mm, but not a single key macro with seconds.

      How do I create a macro shortcut key that will only insert hh:mm:ss+space or -?

      Thanks, Ron

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Ron Shaw
        last edited by Claudia Frank

        @Ron-Shaw

        I would use python script plugin and code like

        import datetime
        editor.appendText(datetime.datetime.today().strftime("%H:%M:%S"))
        

        to solve this. If you want to install this plugin I would recommend to use
        msi
        instead of
        plugin manager

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors