FSharp.Management


The SystemTimeZones type provider

This tutorial shows the use of the SystemTimeZones type provider.

alt text

1: 
2: 
3: 
#r "FSharp.Management.dll"
open FSharp.Management
open System

Answer to a question from stackoverflow.com.

1: 
2: 
3: 
4: 
let utc = DateTime(2010, 6, 2, 16, 37, 19, DateTimeKind.Utc)
let ctsTZ = SystemTimeZones.``(UTC-06:00) Central Time (US & Canada)``
printfn "Central Standard Time: %A" <| TimeZoneInfo.ConvertTimeFromUtc(utc, ctsTZ)
// Central Standard Time: 6/2/2010 11:37:19 AM
namespace FSharp
namespace FSharp.Management
namespace System
val utc : DateTime

Full name: SystemTimeZonesProvider.utc
Multiple items
type DateTime =
  struct
    new : ticks:int64 -> DateTime + 10 overloads
    member Add : value:TimeSpan -> DateTime
    member AddDays : value:float -> DateTime
    member AddHours : value:float -> DateTime
    member AddMilliseconds : value:float -> DateTime
    member AddMinutes : value:float -> DateTime
    member AddMonths : months:int -> DateTime
    member AddSeconds : value:float -> DateTime
    member AddTicks : value:int64 -> DateTime
    member AddYears : value:int -> DateTime
    ...
  end

Full name: System.DateTime

--------------------
DateTime()
   (+0 other overloads)
DateTime(ticks: int64) : unit
   (+0 other overloads)
DateTime(ticks: int64, kind: DateTimeKind) : unit
   (+0 other overloads)
DateTime(year: int, month: int, day: int) : unit
   (+0 other overloads)
DateTime(year: int, month: int, day: int, calendar: Globalization.Calendar) : unit
   (+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int) : unit
   (+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, kind: DateTimeKind) : unit
   (+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, calendar: Globalization.Calendar) : unit
   (+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int) : unit
   (+0 other overloads)
DateTime(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int, kind: DateTimeKind) : unit
   (+0 other overloads)
type DateTimeKind =
  | Unspecified = 0
  | Utc = 1
  | Local = 2

Full name: System.DateTimeKind
field DateTimeKind.Utc = 1
val ctsTZ : TimeZoneInfo

Full name: SystemTimeZonesProvider.ctsTZ
type SystemTimeZones =
  static member ``(UTC) Coordinated Universal Time`` : TimeZoneInfo
  static member ``(UTC+00:00) Casablanca`` : TimeZoneInfo
  static member ``(UTC+00:00) Dublin, Edinburgh, Lisbon, London`` : TimeZoneInfo
  static member ``(UTC+00:00) Monrovia, Reykjavik`` : TimeZoneInfo
  static member ``(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna`` : TimeZoneInfo
  static member ``(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague`` : TimeZoneInfo
  static member ``(UTC+01:00) Brussels, Copenhagen, Madrid, Paris`` : TimeZoneInfo
  static member ``(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb`` : TimeZoneInfo
  static member ``(UTC+01:00) West Central Africa`` : TimeZoneInfo
  static member ``(UTC+01:00) Windhoek`` : TimeZoneInfo
  ...

Full name: FSharp.Management.SystemTimeZones
val printfn : format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
type TimeZoneInfo =
  member BaseUtcOffset : TimeSpan
  member DaylightName : string
  member DisplayName : string
  member Equals : other:TimeZoneInfo -> bool
  member GetAdjustmentRules : unit -> AdjustmentRule[]
  member GetAmbiguousTimeOffsets : dateTimeOffset:DateTimeOffset -> TimeSpan[] + 1 overload
  member GetHashCode : unit -> int
  member GetUtcOffset : dateTimeOffset:DateTimeOffset -> TimeSpan + 1 overload
  member HasSameRules : other:TimeZoneInfo -> bool
  member Id : string
  ...
  nested type AdjustmentRule
  nested type TransitionTime

Full name: System.TimeZoneInfo
TimeZoneInfo.ConvertTimeFromUtc(dateTime: DateTime, destinationTimeZone: TimeZoneInfo) : DateTime
Fork me on GitHub