Click or drag to resize

CelestialLunar_LocalTime Method

Note: This API is now obsolete.

Converts lunar time values to local time.

Namespace:  CoordinateSharp
Assembly:  CoordinateSharp (in CoordinateSharp.dll) Version: 2.5.1.1
Syntax
C#
[ObsoleteAttribute("Use instance method 'Coordinate.Celestial_LocalTime(double hourOffset)'.")]
public static Celestial Lunar_LocalTime(
	Coordinate coord,
	double offset
)

Parameters

coord
Type: CoordinateSharpCoordinate
Coordinate
offset
Type: SystemDouble
UTC offset

Return Value

Type: Celestial
Celestial
Examples
The following example demonstrates how to get Celestial, lunar time only values in Local time. DateTime offsets are done manually for readability purposes of this example.
//Local time 
 DateTime d = new DateTime(2018, 3, 19, 6, 56, 0, 0, DateTimeKind.Local);

//EST Time is -4 hours from UTC
double offset = -4;

//Convert the date to UTC time
d = d.AddHours(offset*-1);

//Create a Coordinate with the UTC time        
Coordinate c = new Coordinate(39.0000, -72.0000, d);
//Create a new Celestial object by converting the existing one to Local
Celestial celestial = Celestial.Lunar_LocalTime(c, offset);

Console.WriteLine(celestial.IsMoonUp); //False
Console.WriteLine(celestial.SunRise); //3/19/2018 08:17 AM
See Also