| Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map | Here |
| A Tinderbox Reference File : Import/Export/Formatting : Date Formats |
Date Formats |
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. Do remember that the individual codes an be defined in a sting format string - the codes below are thus like placeholders in a literal string:
On 29 February 2012 on a UK-locale system this makes $MyString: Today is Wednesday, 29 February 2012 Note above how the spaces and comma within the format string are retained. Below, the colons after each (bolded) code are not part of that format code but just a divider from the text that follows it; codes are all one or two characters. In places, clarification is given, e.g. number zero versus letter o. 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 from the same format string may differ depending on your computer OS' local system settings (OS X, see System Preferences - Languages & Text -Formats; in OS 10.5.x and earlier use System Preferences - International - formats). For reference, this TBX was authored on a system using UK settings, so generally you will see example dates use day/month order. Date/Time formatting codes Specific complete formats:- L : local date/time, as in the 'long' format of the host system format settings. Examples: US: UK: l : local date, in short format, using the system format settings. Examples: US: UK: * : date/time in RFC 822 format. Example: = : date in ISO 8601 format. Example: Formatting code for specific parts of date/time, combine as required for custom format strings:- Formatting codes for the day part of a date:- d : day of the month, not zero-padded. Example: 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: M0 : formats the month as a two digit number, with a leading zero as required: 01-12. Example: M : abbreviation of month. Example: MM : name of month. Example: Formatting codes for the year part of a date:- y : 4 digit year. Example: Y : 2 digit year (last 2 digits of year). Example: Formatting codes for time:- t : time, in local format. Examples: US: UK: 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: H : hour of the day on a 12-hour clock. Example: 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: 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 |
![]() |
Possible relevant notes (via "Similar Notes" feature):
| Up: Import/Export/Formatting | |||
| Previous: Copying/Moving text within Tinderbox | Next: Default Export Location | ||
| |
|||
|
|||
Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map
[Last updated: 16 May 2012, using v5.11.1]
Search:
aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
[See aTbRef CC licence Attribution & Waiver info]