This version is out of date, covering development from v4.6.0 to v4.7.1. It is maintained here only for inbound reference links from elsewhere.
Jump to the current version of aTbRef.
|A Tinderbox Reference File : Import/Export/Formatting : Date Formats||aTbRef Site Map|
Tinderbox offers numerous date formats. An example date Tue, 29 Apr 2003 14:32:18 - 0500 is used to show the following various format strings below. Note below that the colons after each (bolded) code are not part of that format code but just a divider from the text that follows it. Dates before 1 January 1904 (start of the Mac OS calendar) are supported - see more.
Important note - the examples here are for US & UK system settings so as to illustrate day/month and month days variations. The exact format you see on your system may differ depending on your computer OS' local system settings (OS X, see System Preferences - International - formats). For reference this TBX was authored on a system using UK settings.
Date/Time formatting codes:-
L : local date/time, as in the 'long' format of the host system format settings. Examples:
April 29, 2003
29 April 2003
l : local date, in short format, using the system format settings. Examples:
* : date/time in RFC 822 format. Example:
Tue, Apr 29, 2003 14:32:18 +0500
= : date in ISO 8601 format. Example:
Formatting codes for the day part of a date:-
d : day of the month, not zero-padded. Example:
9 (note, not '09')
D : formats the date of the month as a two digit number, with a leading zero as required (01-31). Example:
w : abbreviation of weekday. Example:
W : name of weekday. Example:
Formatting codes for the month part of a date:-
m : number of month, not zero-padded. Example:
4 (note, not '04')
M0 : formats the month as a two digit number, with a leading zero as required: 01-12. Example:
04. Note the second format character is zero, i.e. the format code is 'em-zero' not 'em-oh'.
M : abbreviation of month. Example:
MM : name of month. Example:
Formatting codes for the year part of a date:-
y : 4 digit year. Example:
2003. (On some countries' settings this may still be 2 digits.)
Y : 2 digit year (last 2 digits of year). Example:
Formatting codes for time:-
t : time, in local format. Examples:
Formatting codes for the hour part of a time:-
h : hour of the day on a 24-hour clock, zero-padded for single digits. Examples:
14 from 14:32/2:32 PM,
05 from 05:32/5:32 AM.
H : hour of the day on a 12-hour clock. Example:
2 from 14:32/2:32 PM,
5 from 05:32/5:32 AM. Use with 'p' to show AM or PM suffix, e.g. "H:mm p" gives
p : the A.M. or P.M. of the hour, always uppercase, with no periods. Example:
Formatting codes for the minute part of a time:-
mm : minute of the hour, zero-padded for single digits. Examples:
32 for 32 past or
05 for five minutes after the hour.
Formatting codes for the seconds part of a time:-
s : second of minute, zero-padded for single digits. Examples:
Escaping any of above as literals:-
Prefacing any character with a backslash, \, includes the that character literally, even if it otherwise has a special meaning in the above list. Thus a format string of "\dd \mm \yY" gives the output
d29 m4 y03. Any other character includes the character. Thus, the format string "Local time:- h:mm:s" gives output of
Local time:- 14:32:18.
|Previous: Copying/Moving text within Tinderbox||Next: Dragging a URL from web browser|
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]