Ejemplo n.º 1
0
 ///<summary>
 ///  Default GeoLocation constructor will set location to the Prime Meridian
 ///  at Greenwich, England and a TimeZone of GMT. The longitude will be set to
 ///  0 and the latitude will be 51.4772 to match the location of the
 ///  <a href = "http://www.rog.nmm.ac.uk">Royal Observatory, Greenwich </a>. No
 ///  daylight savings time will be used.
 ///</summary>
 public GeoLocation()
 {
     LocationName = "Greenwich, England";
     Longitude    = 0; // added for clarity
     Latitude     = 51.4772;
     TimeZone     = new OffsetTimeZone(0);
 }
Ejemplo n.º 2
0
        public void Check_is_offset_timezone_working()
        {
            String locationName = "Lakewood, NJ";
            double latitude     = 40.09596;  //Lakewood, NJ
            double longitude    = -74.22213; //Lakewood, NJ
            double elevation    = 0;         //optional elevation
            var    timeZone     = new OffsetTimeZone(new TimeSpan(0, 0, -14400));
            var    location     = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
            var    czc          = new ComplexZmanimCalendar(new DateTime(2010, 4, 2), location);

            var zman = czc.GetSunrise();

            Assert.That(zman, Is.EqualTo(
                            new DateTime(2010, 4, 2, 6, 39, 41, 832)
                            ));
        }