Created
May 3, 2015 21:37
-
-
Save bjartwolf/0d1884bde4f6d9eeef23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let findHoursInNorwegianDay (year:int) (month:int) (day: int) :int = | |
let zone = DateTimeZoneProviders.Tzdb.GetZoneOrNull("Europe/Oslo") | |
let t1 = new LocalDateTime(year, month,day,0,0) | |
let t2 = t1.PlusDays(1) | |
let z1 = t1.InZoneLeniently(zone) | |
let z2 = t2.InZoneLeniently(zone) | |
let interval = z2.ToInstant()- z1.ToInstant() | |
int (System.Math.Round(TimeSpan.FromTicks(interval.Ticks).TotalHours,0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment