emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal <kaushal.modi@gmail.com>
To: John Kitchin <jkitchin@andrew.cmu.edu>, ndokos@gmail.com
Cc: emacs-org list <emacs-orgmode@gnu.org>, Rasmus <rasmus@gmx.us>
Subject: Re: What is the best way to set #+DATE to today's date?
Date: Thu, 6 Aug 2015 15:45:05 -0400	[thread overview]
Message-ID: <CAFyQvY2z+=Ebuo4u6R1HLiV-VE2aMcHasNUDaBZX-rf3uEMeuw@mail.gmail.com> (raw)
In-Reply-To: <CAFyQvY00bB-Y0VWvkzrxwXG5od6ZhOwqPXO4KR2w_r2uzcqQgQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2037 bytes --]

Actually the documentation does say what {{{time}}} does; I just didn't
read it all this time.

{{{date}}}{{{date(FORMAT)}}}{{{time(FORMAT)}}}{{{modification-time(FORMAT
)}}}
"These macros refer to the #+DATE keyword, *the current date*, and the
modification time of the file being exported, respectively."

Apologies.

And thanks to everyone for giving their time to reply to this.


--
Kaushal Modi

On Thu, Aug 6, 2015 at 3:25 PM, Kaushal <kaushal.modi@gmail.com> wrote:

> @Nick That works! Thank you!
>
> I used the below instead (learned that I needed to escape that comma).
>
> #+DATE: {{{time(%b %d %Y\, %a)}}}
>
> I had read about {{{date}}} but assumed that {{{time}}} does the same
> thing as {{{date}}} because they are put together with the same
> description. The documentation actually doesn't tell what {{{time}}} does:
> http://orgmode.org/manual/Macro-replacement.html
>
>
> @John: Looks like I will not need any elisp hacks :)
>
>
>
> --
> Kaushal Modi
>
> On Thu, Aug 6, 2015 at 2:18 PM, John Kitchin <jkitchin@andrew.cmu.edu>
> wrote:
>
>> I use a function like that here:
>> https://github.com/jkitchin/jmax/blob/master/techela/techela-grade.el#L182
>>
>> and to set the filetag as you suggest you would call it like this:
>>
>> #+BEGIN_SRC emacs-lisp
>> (gb-set-filetag "DATE" (format-time-string "%b %d %Y, %a" (current-time)))
>> #+END_SRC
>>
>> You could put that in some hook function if you like.
>>
>> Kaushal writes:
>>
>> >> Why don't you just use a timestamp?
>> >
>> > But that would need me to insert the timestamp manually each time before
>> > exports
>> >
>> >> You can update whenever you want or using
>> >>    (org-insert-time-stamp (current-time))
>> >> at the right spot.
>> >
>> > Wouldn't that too need manual navigation to #+date: and then eval that
>> > elisp form?
>>
>> --
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>
>
>

[-- Attachment #2: Type: text/html, Size: 6183 bytes --]

  reply	other threads:[~2015-08-06 19:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 16:33 What is the best way to set #+DATE to today's date? Kaushal
2015-08-06 16:44 ` Rasmus
2015-08-06 17:00   ` Kaushal
2015-08-06 17:41     ` Rasmus
2015-08-06 18:18     ` John Kitchin
2015-08-06 19:25       ` Kaushal
2015-08-06 19:45         ` Kaushal [this message]
2015-08-06 19:50           ` Thomas S. Dye
2015-08-06 19:58             ` Kaushal
2015-08-06 20:51               ` [PATCH] " Thomas S. Dye
2015-08-06 21:22                 ` Kaushal
2015-08-06 21:48                   ` Thomas S. Dye
2015-08-06 21:54                     ` Fabrice Niessen
2015-08-06 22:12                       ` Thomas S. Dye
2015-08-07  8:53                         ` Nicolas Goaziou
2015-08-07 14:01                           ` Kaushal
2015-08-07 14:20                             ` Suvayu Ali
2015-08-07 14:52                               ` Kaushal
2015-08-11 18:40                           ` Thomas S. Dye
2015-08-11 22:59                             ` Nicolas Goaziou
2015-08-07  4:31     ` Suvayu Ali
2015-08-06 18:12 ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFyQvY2z+=Ebuo4u6R1HLiV-VE2aMcHasNUDaBZX-rf3uEMeuw@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jkitchin@andrew.cmu.edu \
    --cc=ndokos@gmail.com \
    --cc=rasmus@gmx.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).