SuperDates combine the date and time into a single number…the number of seconds since January 1, 1904. SuperDates make it easy to calculate time intervals across multiple days. However, SuperDates take up more storage than regular dates, and are not as easy to work with. In addition, SuperDates are limited to dates after 1904. (In Panorama 6 and earlier versions, SuperDates were limited to dates between 1904 and 2040, but the 2040 limitation no longer applies to Panorama X. However, if you have a Panorama 6 database that contains SuperDates, you should use the
fixsuperdates statement after converting the database to make sure that the values are correct in Panorama X.) Panorama has several functions for working with SuperDates.
superdate(date,time) This function converts a regular date and a regular time into a superdate. The date parameter is a regular Panorama date. This date must be after 1904 A.D. The time parameter is the number of seconds since midnight, usually computed with the seconds( or time( functions ([see Time Arithmetic Formulas). The result is a single value that combines both the date and time into a single number that can be used for multi-day calculations.
regulardate(number) This function extracts a regular date (number of days from January 1, 4713 B.C.) from a superdate. You can then format this date with the datepattern( function, as is shown in this example (which assumes that the field or variable Arrival contains a SuperDate value).
datepattern(regulardate(Arrival),"Month dd, yyyy")
regulartime(number) This function extracts a regular Panorama time (seconds since midnight) from a SuperDate. You can then format this date with the timepattern( function, as is shown in this example (which assumes that the field or variable Arrival contains a SuperDate value).
timepattern(regulartime(Arrival),"hh:mm am/pm")
superdatepattern(number, datepattern,timepattern) Converts a number containing a superdate to text, allowing you to specify the patterns for both the date and the time portions (see Date Patterns and timepattern(). For example the formula
superdatepattern(supernow(),"Month ddnth yyyy @ " ,"hh:mm am/pm")
will result in something like July 10th, 2008 @ 1:36 PM.
superdatesecondsstr(number) Converts a number containing a superdate to text in standard format including seconds (for example 4/20/03 9:56:37 AM).
superdatestr(number) Converts a number containing a superdate to text in standard format (for example 4/20/03 9:56 AM).
supernow() This function returns the number representing the current date and time as a superdate value (number).
See Also
- Arithmetic Formulas -- mathematical operators and functions.
- Characters and Unicode Values -- working with individual characters of text.
- Constants -- values embedded into a formula.
- Date Arithmetic Formulas -- performing calculations on dates, and converting between dates and text.
- Formula Workshop -- formula workshop wizard for testing and experimenting with formulas.
- formulacalc -- allows you to evaluate a formula that you were not able to
code into the procedure when it was being written.
- Formulas -- basics of formulas: components and grammar.
- formulavalue -- calculates the result of a formula. Usually this is done with an assignment statement (for example `x=2 * y` ), but the *formulavalue* statement gives you more flexibility. You can specify what database is to be used for the calculation (an assignment statement always uses the current database) and you can specify the formula using a variable, making it easy to change on the fly. This statement also gives you more control over how errors are handled.
- Functions -- index of all functions available for use in Panorama formulas.
- Linking with Another Database -- multiple database files working together.
- makemergeformula( -- builds a formula from an “auto-wrap" style merge template.
- Non Decimal Numbers -- working with numbers in alternate (non-decimal) bases, including binary, octal and hexadecimal.
- Numbers -- Working with numeric values in a formula, and converting between numbers and text.
- Operators -- index of all operators available for use in Panorama formulas.
- Quotes -- text constants embedded into a formula
- Statements -- index of all statements available for use in Panorama procedures.
- Tag Parsing --
- Text Formulas -- manipulating text with a formula (concatenation, extraction, rearranging, etc.)
- Time Arithmetic Formulas -- performing calculations on times, and converting between times and text.
- True/False Formulas -- logical boolean calculations.
- Using Fields in a Formula -- accessing database fields within a formula.
- Values -- the raw material that formulas work with -- numbers and text.
- Variables -- storing and retrieving individual items of data, not part of a database.
History
10.0 | No Change | Carried over from Panorama 6.0 |