[lp_date_JulianSplit]

Description

Link: [lp_date_JulianSplit]
Author: Bil Corry
Category: Date
Version: 8.x
License: Public Domain
Posted: Apr. 21, 2006
Updated: Jan. 01, 0001
More by this author...
Returns a map of the Julian date and time, given a Julian date.

Requires [lp_decimal_float] [lp_decimal_fixed] [lp_decimal_precisionset]

Parameters

-julianDate decimal, required The Julian date (expressed as a decimal) to split into the date and time.

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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[

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

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net