Xbasic

JTODATE Function

Syntax

Date_Expression as D = JTODATE(N number)

Arguments

number

An integer value representing a Julian date, as Produced by the JDATE() function. Numeric

Description

Returns a date value which is the equivelant to the supplied Julian number.

Discussion

JTODATE() converts a Julian date (which is an integer value measured in days) to an Alpha Anywhere Date value. After you have used JDATE() to convert dates to numbers (in order to perform computations on them), you can use JTODATE() to display the results as Dates. NOTE: JDATE() now returns values in a numeric format compatible with input to JTODATE(). For example, if the current date is 9/21/1995, then:

? jdate({09/21/1995})
= 2449982.000000
 ? jtodate(2449982.000000)
= {09/21/1995}

Example

' if the current date is 9/21/1995
? jtodate( jdate( DATE() + 7) )
= {09/28/1995}

How to Import a Julian Date

A Julian date is a number cannot be imported directly into a date field. To import a julian date:

1.

Import the Julian date data into a numeric field (e.g. numeric_field ).

2.

Select the Operation tab of the Control Panel.

3.

On the Create New Operation dialog box, select "Update Records" from the Select Operation list.

4.

Select your table from the Select Table/Set list.

5.

Click Create Using Genie.

6.

Click the General tab.

7.

Select "Assign a Calculated Value to a Field" and click Next >.

8.

Select the date field (e.g. date_field ) of your table in the Which field would you like to update? list.

9.

Enter the expression jtodate(numeric_field) in the Enter the expression for the calculated value field.

10.

Click Next >, Next >, Next >, and Finish.

11.

Enter a name for the operation and click OK, OK, and OK.

See Also