emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Daniel Clemente <n142857@gmail.com>
Cc: mailing-list-org-mode <emacs-orgmode@gnu.org>
Subject: Re: Format for timestamp export
Date: Thu, 9 Apr 2009 09:37:09 +0200	[thread overview]
Message-ID: <EB58114C-96C3-454A-8087-8D4AB3EA38B4@gmail.com> (raw)
In-Reply-To: <87skkle5qx.fsf@gmail.com>


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
`org-time-stamp-custom-formats'.

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)
	  (org-time-stamp-custom-formats
	   '("<%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)))))

HTH

- Carsten






>
>
> Thanks,
> Daniel
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2009-04-09  8:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06 23:12 Format for timestamp export Daniel Clemente
2009-04-09  7:37 ` Carsten Dominik [this message]
2009-04-12 18:37   ` Daniel Clemente
2009-04-12 18:43     ` Christopher Suckling
2009-04-13  6:54     ` Carsten Dominik
2009-04-13  8:50       ` Christopher Suckling

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=EB58114C-96C3-454A-8087-8D4AB3EA38B4@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=n142857@gmail.com \
    /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).