11

Hello I am new to Emacs and I have started using org mode for improving my productivity.

Currently when I press C-c . the date format displayed is <2016-01-26 Thu> I would like to change it to <Thu Jan 26th 2016>

How do I make the corresponding changes in my .emacs?

smilingbuddha
  • 1,131
  • 10
  • 26
  • 1
    Check out `C-h v org-time-stamp-formats` and `C-h f format-time-string`. AFAIK, there isn't a built-in way to suffix the likes of `st`, `nd`, `rd`, `th` after the dates. Without those suffixes, the answer is easy. **Update**: Well, looks like there [**is** a way to add those ordinal suffixes](http://stackoverflow.com/a/20317537/1219634). – Kaushal Modi Jan 27 '16 at 04:56
  • 2
    Actually `org-display-custom-times` and `org-time-stamp-custom-formats` might be the variables designed for user to tweak. – Kaushal Modi Jan 27 '16 at 05:08

1 Answers1

13

You can start with something like this:

(setq-default org-display-custom-times t)
(setq org-time-stamp-custom-formats '("<%a %b %e %Y>" . "<%a %b %e %Y %H:%M>"))

This will give you <Thu Jan 26 2016> for date timestamps or <Thu Jan 26 2016 11:30> for timestamps with times. If you want zero-padded dates instead of blank-padded dates use %d instead of %e above (e.g., if you want 09 instead of 9, but I figured blank-padded would be better if you figure out a way to add the ordinal suffix). For a comprehensive list of the formatting symbols, see here. You can try to combine this with the solution here as suggested by @KaushalModi, but I haven't gotten that to work yet.

Also, if you use custom timestamps in org-mode, be aware that there are sometimes undesired side-effects: see this question and answer and this page from the org manual.

elethan
  • 4,755
  • 3
  • 29
  • 56
  • @KaushalModi, thanks for the highlighting! I wasn't sure how to do that! – elethan Jan 27 '16 at 18:35
  • 1
    You are welcome! Just for reference for anyone else, put `` followed by a blank line at the top of a code block. If you have only elisp code blocks but many of them, you can put just one `` at the top of the post. – Kaushal Modi Jan 27 '16 at 18:38