Lasso Soft Inc. > Home

[lp_date_JulianSplit]

Linklp_date_JulianSplit
AuthorBil Corry
CategoryDate
Version8.x
LicensePublic Domain
Posted21 Apr 2006
Updated21 Apr 2006
More by this author...

Description

Returns a map of the Julian date and time, given a Julian date.

Requires [lp_decimal_float] [lp_decimal_fixed] [lp_decimal_precisionset]

Sample Usage

lp_date_JulianSplit: 2450123.7; // map: (time)=(0.2), (date)=(2450123.5)

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

[

define_tag:'lp_date_JulianSplit',
	-description='Returns a map of the Julian date and time, given a Julian date.',
	-priority='replace',
	-required='JulianDate';
	
	local:'jd' = (decimal: #juliandate);
	if: (lp_decimal_float: #jd) >= 0.5;
		local:'jd0' = (decimal:(lp_decimal_fixed: #JulianDate)) + 0.5;
	else;
		local:'jd0' = (decimal:(lp_decimal_fixed: #JulianDate)) - 0.5;
	/if;

	return: (map: 'date' = (lp_decimal_precisionset:#jd0), 'time' = (lp_decimal_precisionset:(math_abs: #jd - #jd0)));

/define_tag;

]

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft