Date format: Difference between revisions
Content deleted Content added
m Emacs Lisp: Add comments |
|||
Line 1,753: | Line 1,753: | ||
<lang Lisp>(format-time-string "%Y-%m-%d") |
<lang Lisp>(format-time-string "%Y-%m-%d") |
||
(format-time-string "%F") ;; new in Emacs 24 |
(format-time-string "%F") ;; new in Emacs 24 |
||
=> "2015-11-08" |
;; => "2015-11-08" |
||
(format-time-string "%A, %B %e, %Y") |
(format-time-string "%A, %B %e, %Y") |
||
=> "Sunday, November 8, 2015" |
;; => "Sunday, November 8, 2015"</lang> |
||
</lang> |
|||
<code>%e</code> is blank-padded day number, or <code>%d</code> for zero-padded. Month and weekday names follow the current locale. On a POSIX style system this is the usual <code>LC_TIME</code> or <code>LC_ALL</code> environment variables. GNU Emacs variable <code>system-time-locale</code> can override this if desired. |
<code>%e</code> is blank-padded day number, or <code>%d</code> for zero-padded. Month and weekday names follow the current locale. On a POSIX style system this is the usual <code>LC_TIME</code> or <code>LC_ALL</code> environment variables. GNU Emacs variable <code>system-time-locale</code> can override this if desired. |