Date Attributes

Tinderbox Icon

Date

A date and time string. It should always be enclosed in double quotes (legacy code without these may cease to work as expected). Dates can be added/subtracted/compared in mathematical fashion, as per number data types. The resulting 'string' can be formatted by means of date format codes. If no default value is specified, a Date type defaults to a value of never. If a date is specified but not a time, time always defaults to '00:00' (visual format may vary by locale - e,g, in the use of the colon delimiter).

Time is used in date comparisons except when the == or != operators are used. Also see Basic Comparison Operators; the same rules hold true for data comparisons in action code expressions.

Tinderbox recognises today, now, yesterday, tomorrow, day, week, month and year as date placeholders, i.e. date designators. Constructions like "yesterday + 1 week" or "tomorrow + 1 year" are also possible; note how the whole expression is placed in one set of double quotes. The 'now' placeholder can be used as an alternate for 'today'. Use of these placeholders won't result in a "00:00" time stamp as with manually input dates but rather the current time as the placeholders are effectively N days offset backwards or forwards from 'now'.

Dates are recognised that use slashes "1/7/05" and the Continental format with periods, e.g. '1.7.05'.

Tinderbox handles dates, in attributes & expressions, from before 1 January 1904. Those wishing to use such dates should use the Formats pane of the International pane (Formats tab) of the Mac OS System Preferences and set four-digit year numbers. To do this (for a region), on the Formats tab, click the the 'Customize...' button to the right of the example dates. The 'Show' pop-up is most likely set to 'Short' - leave it as that. In the white text box below click on to year; you will see a drop-down menu that will allow you to choose either 2-digit or 4-digit dates, select the four-digit date. US users should note the default US setting for "short" date formats is to display 2-digit years, i.e. 10/3/65 (for 1765, 1865, etc.). From v4.7.1, all numeric reverse-order dates like '20090130' can be used though do test the exact desired format before committing to extensive use.

Tinderbox XML documents store dates using ISO 8601 format. Originally, dates were stored as American dates and this caused some conflicts in Finnish use. Tinderbox also recognises date strings entered as key attributes or converted from strings in actions when in the ISO 8601 format (e.g. 2008-11-20 16:55:01).

Two dates may be subtracted with a result in days even if the result is a string. This helps with tasks like setting DisplayExpression.

Tinderbox offers numerous date formats.

Attributes of the date data type are listed below.


Up: Attribute Data Types
Previous: Boolean Attributes  Next: Set Attributes 

[Last updated: 14 Dec 2009, using v5.0]

Google search aTbRef for:  

Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]

Creative Commons License

Made with Tinderbox