3.5.9.12 Second

Description

Returns seconds in the range 0 (zero) to 59.9999... The argument can be any real number since the function interprets the decimal part as the fraction of 24 hours and calculates seconds accordingly.

See this note.

Syntax

double Second(double d, int n[, int elapsed])

Parameters

d

Julian-date value, which can include time

n

is a integer value, there are two options
 0 return seconds with more digits† return seconds with 3 digits.

Note that the second() function takes a Julian-date value. The precision of Julian date values is limited to 0.0001 seconds when rounded at the fourth decimal digit.

elapsed

Optional argument, 1 to return elapsed time period

Return

If input is a valid Julian-date value, returns the seconds, ranging from 0 (zero) to 59.9999....

If input is not a valid Julian-date value, return -1.

Example

double a1 = second(0.5997454);
a1 = ;// default returns seconds to three decimal digits, 38.003
double a2 = second(0.5997454, 0);
a2 = ; // returns seconds with more digits, 38.002541363239
double bb = second(2454827.5982639, 0); // 2454827.5982639 == date(12/27/2008 14:21:30)
bb = ; // returns seconds with more digits, 30.000942349434
double dTime = Time(25:30:21);
Second(dTime,1,1) =; //91821