How to get day of week from "now" ?
i know there is "now :: TimeData" defined to get the current time's TimeData
But how can I extract day of week (e.g. Monday, Tue, etc.) from it ? Inside TTime.timePred, right? But what should i do next ?
Thanks in advance
It depends on what you're trying to do. If you're trying to get day of the week from a Time entity returned by Duckling you should be able to do it using the standard libraries (see: http://hackage.haskell.org/package/time-1.9.1/docs/Data-Time.html).
TTime also has a TTime.DayOfWeek. See https://github.com/facebook/duckling/blob/master/Duckling/Time/Helpers.hs for reference on how it's used.
If neither of those work for your use case, can you provide a bit more information about what you're trying to do?
Hi, for example I have a calculator to convert current Year to current Lunar Year in calendar, will I be able to extract this current Year value from "now/today::Time Data" inside the Rule function ?