emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Georges Ko <gko@gko.net>
To: emacs-orgmode@gnu.org
Subject: Re: Convert from date to week number, howto?
Date: Fri, 03 Feb 2012 23:58:48 +0800	[thread overview]
Message-ID: <yd8rzkcz3o3r.fsf@gko.net> (raw)
In-Reply-To: 81mx91qid0.fsf@gmail.com

Jambunathan K <kjambunathan@gmail.com> writes:

>> I sometimes have to convert from a date to a week number, 
>
> Try this. 
>
> (org-odt-format-date "<2011-12-31 Sat>" "%U")
> (org-odt-format-date "[2011-12-24 Sat]" "%U")
>
> You can steal the implementation. The functions have nothing to do with
> org-odt, btw.

Another way to get the week of the year is:

(require 'calendar)
(require 'cal-iso)

(car
  (calendar-iso-from-absolute
    (calendar-absolute-from-gregorian 
      (list month day year))))
-- 
 Georges Ko                     gko@gko.net                      2012-02-03

      reply	other threads:[~2012-02-03 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 16:16 Convert from date to week number, howto? François Pinard
2012-02-02 16:32 ` Nick Dokos
2012-02-12  5:17   ` François Pinard
2012-02-02 17:02 ` Jambunathan K
2012-02-03 15:58   ` Georges Ko [this message]

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=yd8rzkcz3o3r.fsf@gko.net \
    --to=gko@gko.net \
    --cc=emacs-orgmode@gnu.org \
    /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).