[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Format for timestamp export

From: Carsten Dominik
Subject: Re: [Orgmode] Format for timestamp export
Date: Thu, 9 Apr 2009 09:37:09 +0200

On Apr 7, 2009, at 1:12 AM, Daniel Clemente wrote:

Hi. Since I edit my files from different computers, each with different locales, I end up with dates like:

  CLOCK: [2009-04-01 mié 14:15]--[2009-04-01 mié 14:22] =>  0:07
    SCHEDULED: <2009-03-26 dj 18:00>
CLOSED: [2007-11-25 So 19:05]

… <2007-08-31 Fri 17:25>

Emacs and I can live with these localised week day names, but to external (HTML) users I would like to show dates in a custom format so that they always look the same.

Can I format timestamps on export?

You can customize them for display, which will also
transfer to exported files.
Check out the variables `org-display-custom-times' and

When you turn this on, you lose some of the editing capabilities
for time stamps with S-cursor keys.  So if you really only need it
for export, you can use one of the export preprocessor hooks and
change all the time stamps with a function like (untested):

(add-hook 'org-export-preprocess-final-hook
 (lambda ()
   (let ((org-display-custom-times t)
           '("<%m/%d/%y %a>" . "<%m/%d/%y %a %H:%M>"))) ;; customize!
     (goto-char (point-min))
     (while (re-search-forward org-ts-regexp-both nil t)
        (replace-match (save-match-data
                         (org-translate-time (match-string 0)))
                       t t)))))


- Carsten


Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]