CelestialLunar_LocalTime Method

Note: This API is now obsolete.
Converts lunar time values to local time.

Definition

Namespace: CoordinateSharp
Assembly: CoordinateSharp (in CoordinateSharp.dll) Version: 2.21.1.1
XMLNS for XAML: Not mapped to an xmlns.
C#
[ObsoleteAttribute("Use instance method 'Coordinate.Celestial_LocalTime(double hourOffset)'.")]
public static Celestial Lunar_LocalTime(
	Coordinate coord,
	double offset
)

Parameters

coord  Coordinate
Coordinate
offset  Double
UTC offset

Return Value

Celestial
Celestial

Example

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.
C#
//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