Product: LABELVIEW, CODESOFT
Version: All Versions
|
BestBefore(«date», «dateFormat», «offset», «offsetUnit», «changeMonth», «outputFormat») calculates a Best Before date based on a specified input date rather than the current system date.
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| Return Value | String | A calculated date returned as a formatted string. |
| date | String | The base date value in string format. |
| dateFormat | String / Number | Defines the format of the base date.
|
| offset | Number | The number of date units added to the base date. |
| offsetUnit | String / Number | Defines the offset unit:
|
| changeMonth | Number | Optional (Default = True)
|
| outputFormat | String / Number | Optional. If omitted, the output format matches the input date format. Supports the same values as dateFormat. |
Predefined Date Formats
| Number | Date Format |
|---|---|
| 1 | dd/mm |
| 2 | dd mmmm |
| 3 | dd/mm/yy |
| 4 | dd/mm/yyyy |
| 5 | mm/dd |
| 6 | mmmm dd |
| 7 | mm/dd/yy |
| 8 | mm/dd/yyyy |
| 9 | mmm-yy |
| 10 | mmmm-yy |
| 11 | dd-mmm-yy |
| 12 | dd-mmmm-yy |
| 13 | d/m/yy |
| 14 | dddd/m/yy |
| 15 | ddddd/m/yy |
| 16 | d/m/yyyy |
| 17 | dd/mmmm/yyyy |
| 18 | d mmmm yyyy |
| 19 | ddddd dd mmm yyyy |
| 20 | dd/mm/yy h:nn |
| 21 | mm/dd/yy h:nn |
Examples
Syntax
BestBefore («date», «dateFormat», «offset», «offsetUnit», «changeMonth», «outputFormat»)
BestBefore («date», «dateFormat», «offset», «offsetUnit», «changeMonth», «outputFormat»)
- BestBefore("14/06/2012", "dd/mm/yyyy", "18", "m", 1, "dd/mm/yyyy") returns 14/12/2013.
Example Using a Date Variable
- Create a date variable named date0 containing the current date (for example: 26/06/2012 in dd/mm/yy format).
- BestBefore(date0, "dd/mm/yy", "18", "m", 1, "dd/mm/yyyy") returns the date 18 months after the value stored in date0.
|
