Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Insert time only as hh:mm:ss

    Help wanted · · · – – – · · ·
    2
    2
    4473
    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 Shaw
      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 Frank 1 Reply Last reply Reply Quote 0
      • Claudia Frank
        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
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors