Loading ...
Sorry, an error occurred while loading the content.

[jasspa] insert-date (format: 01-Oct-99)

Expand Messages
  • Thomas Hundt
    I use the following to insert a date, because I like the format 01-Oct-99: define-macro insert-date insert-string &add 0 &mid $time 9 1 ; make space into 0
    Message 1 of 1 , Oct 1, 1999
    • 0 Attachment
      I use the following to insert a date, because I like the format 01-Oct-99:

      define-macro insert-date
      insert-string &add 0 &mid $time 9 1 ; make space into '0'
      insert-string &mid $time 10 1
      insert-string "-"
      insert-string &mid "JanFebMarAprMayJunJulAugSepOctNovDec" &add 0 &mul 3 &sub &mid $time 7 2 1 3 ; MMM
      insert-string "-"
      insert-string &mid $time 2 2 ; YY
      !emacro ; insert-date
      global-bind-key insert-date "esc @"

      Note that it's easier to work with $time than the output of ascii-time, since dates are always two characters in $time. (One of them is often a space, but at least that's better than everything after it in the string sliding around.)

      (Jasspa authors note: the help file says ascii-time is defined in misc.emf, and it's really in utils.)

      -Th
    Your message has been successfully submitted and would be delivered to recipients shortly.