lilypond-user
[Top][All Lists]
Advanced

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

Re: Fatal bug in strftime?


From: Peter Toye
Subject: Re: Fatal bug in strftime?
Date: Wed, 22 May 2013 17:07:10 +0100

David,

Thanks. Hardly worth the effort! I think I'll just try to ignore my allergy to leading zeroes in dates. Or not do any engraving 1-9 of the month.

I'm no LISP expert, apart from knowing that it stands for Lots of Irritating Surplus Parentheses.

Best regards,

Peter
mailto:address@hidden
www.ptoye.com

-------------------------
Monday, May 13, 2013, 2:39:51 PM, you wrote:


Hi Peter,

> When I try to use the %e format to get rid of leading zeros in the date, lilypond crashes out.

As a workaround, you could just use %d and check for a leading zero, replacing it with a space.  Something like this:

\header {
  title = "title"
  composer = "no-one"
  tagline = \markup {
    Engraved
    \simple #(let ((date (strftime "%d/%m/%Y" (localtime (current-time)))))
                (if (string-prefix? "0" date)
                    (string-append " " (string-drop date 1))
                    date))
    with \with-url #"
http://lilypond.org/"
    \line { LilyPond \simple #(lilypond-version) (
http://lilypond.org/) }
  }
}

{ c d e f }


Modifications would have to be made if you want the day in other than the leading position.

Anyway, hope this helps.

-David

reply via email to

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