W3cubDocs

/Haskell 7

Data.Time.Calendar.WeekDate

Safe Haskell Safe
Language Haskell2010

Description

ISO 8601 Week Date format

toWeekDate :: Day -> (Integer, Int, Int) Source

convert to ISO 8601 Week Date format. First element of result is year, second week number (1-53), third day of week (1 for Monday to 7 for Sunday). Note that "Week" years are not quite the same as Gregorian years, as the first day of the year is always a Monday. The first week of a year is the first week to contain at least four days in the corresponding Gregorian year.

fromWeekDate :: Integer -> Int -> Int -> Day Source

convert from ISO 8601 Week Date format. First argument is year, second week number (1-52 or 53), third day of week (1 for Monday to 7 for Sunday). Invalid week and day values will be clipped to the correct range.

fromWeekDateValid :: Integer -> Int -> Int -> Maybe Day Source

convert from ISO 8601 Week Date format. First argument is year, second week number (1-52 or 53), third day of week (1 for Monday to 7 for Sunday). Invalid week and day values will return Nothing.

showWeekDate :: Day -> String Source

show in ISO 8601 Week Date format as yyyy-Www-d (e.g. "2006-W46-3").

© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/7.10.3/docs/html/libraries/time-1.5.0.1/Data-Time-Calendar-WeekDate.html