3
只是想知道是否有人知道處理日期的開源.Net庫,類似於date.js庫,它允許您執行以下操作。是否有一個與date.js庫等價的開源.NET?
// What date is next thursday?
Date.today().next().thursday();
// Add 3 days to Today
Date.today().add(3).days();
// Is today Friday?
Date.today().is().friday();
// Number fun
(3).days().ago();
// 6 months from now
var n = 6;
n.months().fromNow();
// Set to 8:30 AM on the 15th day of the month
Date.today().set({ day: 15, hour: 8, minute: 30 });
// Convert text into Date
Date.parse('today');
Date.parse('t + 5 d'); // today + 5 days
Date.parse('next thursday');
Date.parse('February 20th 1973');
Date.parse('Thu, 1 July 2004 22:30:00');
我意識到.Net中的DateTime對象已經支持某些功能。我特別感興趣的是以智能方式解析字符串的代碼的最後一部分。
一些類似的問題尋找.Net的自然語言日期解析器:http://stackoverflow.com/questions/55434/how-to-parse-relative-time,http://stackoverflow.com/questions/23689/自然語言日期時間分析器爲網絡,http://stackoverflow.com/questions/466917/natural-language-parser-for-dates-net – 2010-07-20 19:31:35