CelestialSunRise Property

Sunrise time.

Definition

Namespace: CoordinateSharp
Assembly: CoordinateSharp (in CoordinateSharp.dll) Version: 3.1.1.1
XMLNS for XAML: Not mapped to an xmlns.
C#
public DateTime? SunRise { get; }

Property Value

NullableDateTime

Remarks

If DateTime is null, check the SunCondition property.

Example

The following example gets the sunrise time in UTC at N 39, W 72 on 1-March-2018
C#
Coordinate coordinate = new Coordinate(39,-72, new DateTime(2018,3,1));
Console.WriteLine(coordinate.CelestialInfo.SunRise); //3/1/2018 11:22:04 AM (UTC)
The following example demonstrates a returned null SunRise value as the sun does not rise at N 39, W 72 on 1-March-2018. You can see why there is no value returned by checking the SunCondition property to see that the sun is down all day at the specified location.
C#
Coordinate coordinate = new Coordinate(85,-72, new DateTime(2018,3,1));
Console.WriteLine(coordinate.CelestialInfo.SunSet); //Returns Null
Console.WriteLine(coordinate.CelestialInfo.SunCondition); //DownAllDay

See Also