[{"name":"Time","comment":" Library for working with time and time zones.\n\n# Time\n@docs Posix, now, every, posixToMillis, millisToPosix\n\n# Time Zones\n@docs Zone, utc, here\n\n# Human Times\n@docs toYear, toMonth, toDay, toWeekday, toHour, toMinute, toSecond, toMillis\n\n# Weeks and Months\n@docs Weekday, Month\n\n# For Package Authors\n@docs customZone, getZoneName, ZoneName\n\n","unions":[{"name":"Month","comment":" Represents a `Month` so that you can convert it to a `String` or `Int`\nhowever you please. For example, if you need the Danish representation, you\ncan say:\n\n    toDanishMonth : Month -> String\n    toDanishMonth month =\n      case month of\n        Jan -> \"januar\"\n        Feb -> \"februar\"\n        Mar -> \"marts\"\n        Apr -> \"april\"\n        May -> \"maj\"\n        Jun -> \"juni\"\n        Jul -> \"juli\"\n        Aug -> \"august\"\n        Sep -> \"september\"\n        Oct -> \"oktober\"\n        Nov -> \"november\"\n        Dec -> \"december\"\n","args":[],"cases":[["Jan",[]],["Feb",[]],["Mar",[]],["Apr",[]],["May",[]],["Jun",[]],["Jul",[]],["Aug",[]],["Sep",[]],["Oct",[]],["Nov",[]],["Dec",[]]]},{"name":"Posix","comment":" A computer representation of time. It is the same all over Earth, so if we\nhave a phone call or meeting at a certain POSIX time, there is no ambiguity.\n\nIt is very hard for humans to _read_ a POSIX time though, so we use functions\nlike [`toHour`](#toHour) and [`toMinute`](#toMinute) to `view` them.\n","args":[],"cases":[]},{"name":"Weekday","comment":" Represents a `Weekday` so that you can convert it to a `String` or `Int`\nhowever you please. For example, if you need the Japanese representation, you\ncan say:\n\n    toJapaneseWeekday : Weekday -> String\n    toJapaneseWeekday weekday =\n      case weekday of\n        Mon -> \"月\"\n        Tue -> \"火\"\n        Wed -> \"水\"\n        Thu -> \"木\"\n        Fri -> \"金\"\n        Sat -> \"土\"\n        Sun -> \"日\"\n","args":[],"cases":[["Mon",[]],["Tue",[]],["Wed",[]],["Thu",[]],["Fri",[]],["Sat",[]],["Sun",[]]]},{"name":"Zone","comment":" Information about a particular time zone.\n\nThe [IANA Time Zone Database][iana] tracks things like UTC offsets and\ndaylight-saving rules so that you can turn a `Posix` time into local times\nwithin a time zone.\n\nSee [`utc`](#utc), [`here`](#here), and [`Browser.Env`][env] to learn how to\nobtain `Zone` values.\n\n[iana]: https://www.iana.org/time-zones\n[env]: /packages/elm/browser/latest/Browser#Env\n","args":[],"cases":[]},{"name":"ZoneName","comment":" **Intended for package authors.**\n\nThe `getZoneName` function relies on a JavaScript API that is not supported\nin all browsers yet, so it can return the following:\n\n    -- in more recent browsers\n    Name \"Europe/Moscow\"\n    Name \"America/Havana\"\n\n    -- in older browsers\n    Offset 180\n    Offset -300\n\nSo if the real info is not available, it will tell you the current UTC offset\nin minutes, just like what `here` uses to make zones like `customZone -60 []`.\n","args":[],"cases":[["Name",["String.String"]],["Offset",["Basics.Int"]]]}],"aliases":[],"values":[{"name":"customZone","comment":" **Intended for package authors.**\n\nThe documentation of [`here`](#here) explains that it has certain accuracy\nlimitations that block on adding new APIs to JavaScript. The `customZone`\nfunction is a stopgap that takes:\n\n1. A default offset in minutes. So `Etc/GMT-5` is `customZone (-5 * 60) []`\nand `Etc/GMT+9` is `customZone (9 * 60) []`.\n2. A list of exceptions containing their `start` time in \"minutes since the Unix\nepoch\" and their `offset` in \"minutes from UTC\"\n\nHuman times will be based on the nearest `start`, falling back on the default\noffset if the time is older than all of the exceptions.\n\nWhen paired with `getZoneName`, this allows you to load the real IANA time zone\ndatabase however you want: HTTP, cache, hardcode, etc.\n\n**Note:** If you use this, please share your work in an Elm community forum!\nI am sure others would like to hear about it, and more experience reports will\nhelp me and the any potential TC39 proposal.\n","type":"Basics.Int -> List.List { start : Basics.Int, offset : Basics.Int } -> Time.Zone"},{"name":"every","comment":" Get the current time periodically. How often though? Well, you provide an\ninterval in milliseconds (like `1000` for a second or `60 * 1000` for a minute\nor `60 * 60 * 1000` for an hour) and that is how often you get a new time!\n\nCheck out [this example](https://elm-lang.org/examples/time) to see how to use\nit in an application.\n\n**This function is not for animation.** Use the [`onAnimationFrame`][af]\npackage for that sort of thing! It syncs up with repaints and will end up\nbeing much smoother for any moving visuals.\n\n[af]: /packages/elm/browser/latest/Browser-Events#onAnimationFrame\n","type":"Basics.Float -> (Time.Posix -> msg) -> Platform.Sub.Sub msg"},{"name":"getZoneName","comment":" **Intended for package authors.**\n\nUse `Intl.DateTimeFormat().resolvedOptions().timeZone` to try to get names\nlike `Europe/Moscow` or `America/Havana`. From there you can look it up in any\nIANA data you loaded yourself.\n","type":"Task.Task x Time.ZoneName"},{"name":"here","comment":" Produce a `Zone` based on the current UTC offset. You can use this to figure\nout what day it is where you are:\n\n    import Task exposing (Task)\n    import Time\n\n    whatDayIsIt : Task x Int\n    whatDayIsIt =\n      Task.map2 Time.toDay Time.here Time.now\n\n**Accuracy Note:** This function can only give time zones like `Etc/GMT+9` or\n`Etc/GMT-6`. It cannot give you `Europe/Stockholm`, `Asia/Tokyo`, or any other\nnormal time zone from the [full list][tz] due to limitations in JavaScript.\nFor example, if you run `here` in New York City, the resulting `Zone` will\nnever be `America/New_York`. Instead you get `Etc/GMT-5` or `Etc/GMT-4`\ndepending on Daylight Saving Time. So even though browsers must have internal\naccess to `America/New_York` to figure out that offset, there is no public API\nto get the full information. This means the `Zone` you get from this function\nwill act weird if (1) an application stays open across a Daylight Saving Time\nboundary or (2) you try to use it on historical data.\n\n**Future Note:** We can improve `here` when there is good browser support for\nJavaScript functions that (1) expose the IANA time zone database and (2) let\nyou ask the time zone of the computer. The committee that reviews additions to\nJavaScript is called TC39, and I encourage you to push for these capabilities! I\ncannot do it myself unfortunately.\n\n**Alternatives:** See the `customZone` docs to learn how to implement stopgaps.\n\n[tz]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\n","type":"Task.Task x Time.Zone"},{"name":"millisToPosix","comment":" Turn milliseconds into a `Posix` time.\n","type":"Basics.Int -> Time.Posix"},{"name":"now","comment":" Get the POSIX time at the moment when this task is run.\n","type":"Task.Task x Time.Posix"},{"name":"posixToMillis","comment":" Turn a `Posix` time into the number of milliseconds since 1970 January 1\nat 00:00:00 UTC. It was a Thursday.\n","type":"Time.Posix -> Basics.Int"},{"name":"toDay","comment":" What day is it?! (Days go from 1 to 31)\n\n    import Time exposing (toDay, utc, millisToPosix)\n\n    toDay utc (millisToPosix 0) == 1\n    toDay nyc (millisToPosix 0) == 31\n\n    -- pretend `nyc` is the `Zone` for America/New_York.\n\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"toHour","comment":" What hour is it? (From 0 to 23)\n\n    import Time exposing (toHour, utc, millisToPosix)\n\n    toHour utc (millisToPosix 0) == 0  -- 12am\n    toHour nyc (millisToPosix 0) == 19 -- 7pm\n\n    -- pretend `nyc` is the `Zone` for America/New_York.\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"toMillis","comment":"\n    import Time exposing (toMillis, utc, millisToPosix)\n\n    toMillis utc (millisToPosix    0) == 0\n    toMillis utc (millisToPosix 1234) == 234\n    toMillis utc (millisToPosix 5678) == 678\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"toMinute","comment":" What minute is it? (From 0 to 59)\n\n    import Time exposing (toMinute, utc, millisToPosix)\n\n    toMinute utc (millisToPosix 0) == 0\n\nThis can be different in different time zones. Some time zones are offset\nby 30 or 45 minutes!\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"toMonth","comment":" What month is it?!\n\n    import Time exposing (toMonth, utc, millisToPosix)\n\n    toMonth utc (millisToPosix 0) == Jan\n    toMonth nyc (millisToPosix 0) == Dec\n\n    -- pretend `nyc` is the `Zone` for America/New_York.\n","type":"Time.Zone -> Time.Posix -> Time.Month"},{"name":"toSecond","comment":" What second is it?\n\n    import Time exposing (toSecond, utc, millisToPosix)\n\n    toSecond utc (millisToPosix    0) == 0\n    toSecond utc (millisToPosix 1234) == 1\n    toSecond utc (millisToPosix 5678) == 5\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"toWeekday","comment":" What day of the week is it?\n\n    import Time exposing (toWeekday, utc, millisToPosix)\n\n    toWeekday utc (millisToPosix 0) == Thu\n    toWeekday nyc (millisToPosix 0) == Wed\n\n    -- pretend `nyc` is the `Zone` for America/New_York.\n","type":"Time.Zone -> Time.Posix -> Time.Weekday"},{"name":"toYear","comment":" What year is it?!\n\n    import Time exposing (toYear, utc, millisToPosix)\n\n    toYear utc (millisToPosix 0) == 1970\n    toYear nyc (millisToPosix 0) == 1969\n\n    -- pretend `nyc` is the `Zone` for America/New_York.\n","type":"Time.Zone -> Time.Posix -> Basics.Int"},{"name":"utc","comment":" The time zone for Coordinated Universal Time ([UTC][])\n\nThe `utc` zone has no time adjustments. It never observes daylight-saving\ntime and it never shifts around based on political restructuring.\n\n[UTC]: https://en.wikipedia.org/wiki/Coordinated_Universal_Time\n","type":"Time.Zone"}],"binops":[]}]
