I want to know how I can get the start of a day/a particular hour.
i.e.: I need to filter a list with all the elements that the attribute ‘date’ is after 11:00 am, local timezone (we can assume timezone = GMT+00:00).
I couldn’t find the way to make this… I prefer to do it without any other library than elm/time (for learning purposes), but if is complicated I can add a package.
I don’t have any problem getting the current date. So, I need to know how to make a function that, given a Posix time, I can get the 11:00 am date for that exactly day (also in posix).
I’d highly recommend using justinmimbs/time-extra, if you go with a package, as it will cover almost everything you need.
If you decide to stick with just elm/time then I’d recommend looking at how that package does floor as this function takes a time zone, a posix value, and an interval (Day, Hour, etc) and gives your the start of it. There’s a lot of other goodies in the source code too around building up specific date-times.