Function: org-format-time-string

org-format-time-string is a function alias for format-time-string, defined in timefns.c.

This function is obsolete since 9.6; use format-time-string instead.

Signature

(org-format-time-string FORMAT-STRING &optional TIME ZONE)

Documentation

Use FORMAT-STRING to format the time value TIME.

A time value that is omitted or nil stands for the current time, a number stands for that many seconds, an integer pair (TICKS . HZ) stands for TICKS/HZ seconds, and an integer list (HI LO US PS) stands for HI*2**16 + LO + US/10**6 + PS/10**12 seconds. This function treats seconds as time since the epoch of 1970-01-01 00:00:00 UTC.

The optional ZONE is omitted or nil for Emacs local time, t for Universal Time, wall for system wall clock time, or a string as in the TZ environment variable. It can also be a list (as from current-time-zone) or an integer (as from decode-time) applied without consideration for daylight saving time.

The value is a copy of FORMAT-STRING, but with certain constructs replaced by text that describes the specified date and time in TIME:

%Y is the year, %y year without century, %C the century.
%G is the year corresponding to the ISO week, %g year corresponding
 to the ISO week, without century.
%m is the numeric month.
%b and %h are the locale's abbreviated month name, %B the full name.
 (%h is not supported on MS-Windows.)
%d is the day of the month, zero-padded, %e is blank-padded.
%u is the numeric day of week from 1 (Monday) to 7, %w from 0 (Sunday) to 6.
%a is the locale's abbreviated name of the day of week, %A the full name.
%U is the week number starting on Sunday, %W starting on Monday,
 %V the week number according to ISO 8601.
%j is the day of the year.

%H is the hour on a 24-hour clock, %I is on a 12-hour clock, %k is like %H
 only blank-padded, %l is like %I blank-padded.
%p is the locale's equivalent of either AM or PM.
%q is the calendar quarter (1–4).
%M is the minute (00-59).
%S is the second (00-59; 00-60 on platforms with leap seconds)
%s is the number of seconds since 1970-01-01 00:00:00 +0000.
%N is the nanosecond, %6N the microsecond, %3N the millisecond, etc.
%Z is the time zone abbreviation, %z is the numeric form.

%c is the locale's date and time format.
%x is the locale's "preferred" date format.
%D is like "%m/%d/%y".
%F is the ISO 8601 date format (like "%+4Y-%m-%d").

%R is like "%H:%M", %T is like "%H:%M:%S", %r is like "%I:%M:%S %p".
%X is the locale's "preferred" time format.

Finally, %n is a newline, %t is a tab, %% is a literal %, and unrecognized %-sequences stand for themselves.

A %-sequence can contain optional flags, field width, and a modifier
(in that order) after the %. The flags are:

- Do not pad the field.
_ Pad with spaces.
0 Pad with zeros.
+ Pad with zeros and put + before nonnegative year numbers with >4 digits.
^ Use upper case characters if possible.
# Use opposite case characters if possible.

A field width N is an unsigned decimal integer with a leading digit nonzero. %NX is like %X, but takes up at least N positions. The field width is (on GNU/Linux and some other systems) in measured in bytes, not characters. It depends on the locale what the width (in characters) %NX will end up being, especially when there are non-ASCII characters in %X.

The modifiers are:

E Use the locale's alternative version. O Use the locale's number symbols.

For example, to produce full ISO 8601 format, use "%FT%T%z".

Aliases

gmm-format-time-string (obsolete since 26.1) org-format-time-string (obsolete since 9.6)