【问题标题】:C# Get year part from dateC# 从日期获取年份部分
【发布时间】:2016-04-25 11:45:03
【问题描述】:

我正在将现有的 vb 应用程序转换为 .net,在现有代码中我找到了以下条件。如何在 C# 中编写此条件?提前致谢

if CLng(Right(request("yr"),4))=CLng(Year(Date())) then
//I am confused only in Year(Date()) how can I replace these functions in C#

【问题讨论】:

    标签: c# .net vb.net datetime


    【解决方案1】:

    Year(Date())可以写成DateTime.Now.Year

    【讨论】:

      猜你喜欢
      • 2012-05-09
      • 2017-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多