相关疑难解决方法(0)

strtotime相当于.NET

是否有相当于PHP的strtotime().NET Framework功能.我在谈论它处理字符串的能力如下:

  • strtotime(" 现在 ")
  • strtotime("2000年9月10日")
  • strtotime(" +1天 ")
  • strtotime(" +1周 ")
  • strtotime(" +1周2天4小时2秒 ")
  • strtotime(" 下周四 ")
  • strtotime(" 上周一 ")

显然DateTime.Parse(),Convert.ToDateTime()不要这样做.

我发现的最接近的是一个只能处理其中一些的小类:http://refactormycode.com/codes/488-parse-relative-date

编辑:我对C#编译时功能感兴趣.问题是在运行时将人类相对日期/时间字符串转换DateTime(即"now" - > DateTime.Now等).

.net string datetime parsing strtotime

4
推荐指数
1
解决办法
5412
查看次数

标签 统计

.net ×1

datetime ×1

parsing ×1

string ×1

strtotime ×1