Difference between revisions of "ParseDate"
(Built-into 4.2) |
|||
Line 4: | Line 4: | ||
[[Category:Doc Status D]] <!-- For Lumina use, do not change --> | [[Category:Doc Status D]] <!-- For Lumina use, do not change --> | ||
− | = ParseDate(x) = | + | == ParseDate(x) == |
− | Parses a textual date into a numeric value indicating the number of days elapsed since Analytica's date origin. When the [[Preferences|"Use Excel date origin"]] preference is not set, the origin is 1 Jan 1904, and when set it is 1 Jan 1900. The integer value returned displays as a date when a date number format is used to display the result. | + | Parses a textual date «x» into a numeric value indicating the number of days elapsed since Analytica's date origin. When the [[Preferences|"Use Excel date origin"]] preference is not set, the origin is 1 Jan 1904, and when set it is 1 Jan 1900. The integer value returned displays as a date when a date number format is used to display the result. |
− | = Library = | + | == Library == |
+ | Text Functions | ||
− | + | == Examples == | |
+ | :<code>ParseDate("1 Aug 2007") → 37833</code> | ||
+ | :<code>ParseDate("8/1/2007") → 37833</code> | ||
− | + | These examples assume English-language regional settings and that the "Use Excel date origin" preference is off. | |
− | |||
− | = | + | == Notes == |
+ | [[ParseDate]] is useful when parsing data read in from textual files. | ||
− | + | There are other ways of entering and parsing dates. You can enter dates directly into definitions or edit table cells when the variable's number format is set to Date. This is generally how dates are entered in models, rather than through the use of [[ParseDate]]. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | There are other ways of entering and parsing dates. You can enter dates directly into definitions or edit table cells when the variable's number format is set to Date. This is generally how dates are entered in models, rather than through the use of ParseDate. | ||
(TO DO) Discuss impact of regional settings on the behavior of date parsing. | (TO DO) Discuss impact of regional settings on the behavior of date parsing. | ||
− | = See Also = | + | == See Also == |
− | |||
* [[ParseNum]] | * [[ParseNum]] | ||
* [[Preferences]] (see "Use Excel date origin") | * [[Preferences]] (see "Use Excel date origin") | ||
− | * [[ReadTextFile]] | + | * [[ReadTextFile]] |
+ | * [[ReadCsvFile]] | ||
* [[MakeDate]] | * [[MakeDate]] | ||
+ | * [[Date Functions]] |
Revision as of 21:50, 14 January 2016
ParseDate(x)
Parses a textual date «x» into a numeric value indicating the number of days elapsed since Analytica's date origin. When the "Use Excel date origin" preference is not set, the origin is 1 Jan 1904, and when set it is 1 Jan 1900. The integer value returned displays as a date when a date number format is used to display the result.
Library
Text Functions
Examples
ParseDate("1 Aug 2007") → 37833
ParseDate("8/1/2007") → 37833
These examples assume English-language regional settings and that the "Use Excel date origin" preference is off.
Notes
ParseDate is useful when parsing data read in from textual files.
There are other ways of entering and parsing dates. You can enter dates directly into definitions or edit table cells when the variable's number format is set to Date. This is generally how dates are entered in models, rather than through the use of ParseDate.
(TO DO) Discuss impact of regional settings on the behavior of date parsing.
See Also
- ParseNum
- Preferences (see "Use Excel date origin")
- ReadTextFile
- ReadCsvFile
- MakeDate
- Date Functions
Enable comment auto-refresher