IConv Date (D) function

Converts a date string into its internal system format.

internal = IConv(string, "D [year] [char] [E] [F] [G] [H] [I] [J] [month_format]")

IConv (D) accepts arguments for the following parameters.

ParameterDescription
stringMust contain a date in a compatible format (refer to "E,F,G,H,I,J" below).

If string is not in the correct format for the conversion, a null is returned.

For a given conversion, you can enter values in a number of different ways. The day, month and year can be separated by almost nay non-numeric character. For example, the conversion "DE", string can be any of the following values:

01 MAR 2009
01 Mar 2009
1 3 09
01 March 2009
01/Mar/2009
01 03 2009
01/03/09
1. MARCH 2009
01 Mar 09
1,3,09
1.3.09
March 1, 2009

You can enter the month as a number, an abbreviation or fully spelled out. If you spell out or abbreviate the month, you must use the exact spelling (including punctuation, if any) in the active language set.

If you do not specify a year, the year from the system clock is used. In addition, if you only specify two digits for the year:

30 to 99 are converted as 1930 to 1999
00 to 29 are converted as 2000 to 2029
DIndicates a date conversion.
year and charThe year and char options have no effect on the IConv function. These are OConv options that are allowed in the IConv function so that you can use the same specifications for both input and output conversions.
E,F,G,H,I,JOptions that determine the order in which the system interprets the date (day, month and year).

Format - Option
01 MAR 2009 - DE
MAR 2009 01 - DF
2009 01 MAR - DG
MAR 01 2009 - DH
01 2009 MAR - DI
2009 MAR 01 - DJ

If you enter the date in numbers, make sure you enter the date and month in the correct order for the option. For option "DE," 6/1/09 converts to 15128, while 1/6/09 converts to 14982.

If you do not specify an option, and if you enter dates as numbers, option H is assumed.
month_formatThis Parameter has no effect on the IConv function. This is an OConv option that is allowed in the IConv function so you can use the same specifications for input and output conversions.

Internally , OpenInsight stores all dates as the number of days since December 31, 1967, which is stored as day 0 (zero).

Any date "after" December 31, 1967, is saved as a positive number, the number of days that have elapsed since that date. Any date "before" December 31, 1967, is saved as a negative number, the number of days prior to that date.

* Assigns to Date the value "15004"

Date = IConv("1/28/09","D")

* Assigns the value 14928 to the variable identifier CD.

CD = IConv("11:13:08","D2:")
IConv("1 Mar 09", "DE")     15036 
IConv("1/3/09", "DE")       15036 
IConv("3.1.09, "DE")        14979 
IConv("09*1*3", "DG")       15036 
IConv("March 1, 2009", "DH")15036 
  • guides/programming/programmers_reference_manual/iconv_date_d.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1