【发布时间】:2017-02-24 18:55:34
【问题描述】:
这是我的代码 sn-p:
public bool getEffDate()
{
testfunction(DateTime.Today.ToString("u"));
return true;
}
private bool testfunction(string modDate)
{
modDate = DateTime.Parse(modDate).ToString("yyyy-MM-dd");
return true;
}
DateTime.Today.ToString("u") - 返回当前日期 而 modDate 返回 current_date - 1..
有人可以帮助我使用 UTC 日期功能吗?为什么 Parse 函数会带来前一天?
【问题讨论】:
-
你在哪个时区?