Click or drag to resize

CelestialSolar_LocalTime Method

Note: This API is now obsolete.

Converts solar time values to local time.

Namespace:  CoordinateSharp
Assembly:  CoordinateSharp (in CoordinateSharp.dll) Version: 2.12.1.1
Syntax
C#
[ObsoleteAttribute("Use instance method 'Coordinate.Celestial_LocalTime(double hourOffset)'.")]
public static Celestial Solar_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, solar 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.Solar_LocalTime(c, offset);

Console.WriteLine(celestial.IsSunUp); //True
Console.WriteLine(celestial.SunRise); //3/19/2018 6:54:25 AM
See Also