Monday, November 08, 2010 at 12:02 AM.
system.verbs.builtins.date.midnight
on midnight (when=clock.now ()) { <<Changes <<1/6/09; 9:02:29 AM by DW <<Created. Another bit of annoying code that appears too often not to be factored. Return midnight of the day in question. local (day, month, year, hour, minute, second); date.get (when, @day, @month, @year, @hour, @minute, @second); return (date.set (day, month, year, 0, 0, 0))} <<bundle //test code <<dialog.alert (date.midnight ())
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.