Re: [Haskell-cafe] Data.Time is so weak ?!
How about: import Data.Time.Calendar import Data.Time.Calendar.WeekDate main = do let (y, w, d) = toWeekDate $ addDays 150 (fromGregorian 2009 8 31) putStrLn $ show d 2009/8/31 zaxis z_a...@163.com: addDays 150 (fromGregorian 2009 8 31) will work. However, how can i get its weekday from the result ? thanks! zaxis wrote: today = fromGregorian 2009 8 31 then how to calculate the day passing 150 days ? today + 150 doesnot work ! -- View this message in context: http://www.nabble.com/Data.Time-is-so-weak--%21-tp25218462p25218554.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Colin Adams Preston, Lancashire, ENGLAND ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Data.Time is so weak ?!
How about: import Data.Time.Calendar import Data.Time.Calendar.WeekDate main = do let (y, w, d) = toWeekDate $ addDays 150 (fromGregorian 2009 8 31) putStrLn $ show d 2009/8/31 zaxis z_a...@163.com: addDays 150 (fromGregorian 2009 8 31) will work. However, how can i get its weekday from the result ? thanks! zaxis wrote: today = fromGregorian 2009 8 31 then how to calculate the day passing 150 days ? today + 150 doesnot work ! -- View this message in context: http://www.nabble.com/Data.Time-is-so-weak--%21-tp25218462p25218554.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Colin Adams Preston, Lancashire, ENGLAND ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Data.Time is so weak ?!
toWeekDate meets my need, thank you! Colin Adams-3 wrote: How about: import Data.Time.Calendar import Data.Time.Calendar.WeekDate main = do let (y, w, d) = toWeekDate $ addDays 150 (fromGregorian 2009 8 31) putStrLn $ show d 2009/8/31 zaxis z_a...@163.com: addDays 150 (fromGregorian 2009 8 31) will work. However, how can i get its weekday from the result ? thanks! zaxis wrote: today = fromGregorian 2009 8 31 then how to calculate the day passing 150 days ? today + 150 doesnot work ! -- View this message in context: http://www.nabble.com/Data.Time-is-so-weak--%21-tp25218462p25218554.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Colin Adams Preston, Lancashire, ENGLAND ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- View this message in context: http://www.nabble.com/Data.Time-is-so-weak--%21-tp25218462p25219065.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Data.Time is so weak ?!
today = fromGregorian 2009 8 31 then how to calculate the day passing 150 days ? today + 150 doesnot work ! -- View this message in context: http://www.nabble.com/Data.Time-is-so-weak--%21-tp25218462p25218462.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Data.Time is so weak ?!
addDays 150 (fromGregorian 2009 8 31) will work. However, how can i get its weekday from the result ? thanks! zaxis wrote: today = fromGregorian 2009 8 31 then how to calculate the day passing 150 days ? today + 150 doesnot work ! -- View this message in context: http://www.nabble.com/Data.Time-is-so-weak--%21-tp25218462p25218554.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe