c# datetime.

DateTime.Month属性 (DateTime.Month Property)

DateTime.Month Property is used to get the year component of this object. It's a GET property of DateTime class.

DateTime.Month属性用于获取此对象的年份组成部分。 这是DateTime类的GET属性。

Syntax:

句法:

    int DateTime.Year;

Return value:

返回值:

The return type of this Property is int, it returns an integer value i.e the year component of this object.

此Property的返回类型为int ,它返回一个整数值,即此对象的Year分量。

Example to demonstrate example of DateTime.Month Property

示例,以演示DateTime.Month属性的示例

using System;
namespace ConsoleApplication1
{class Program
{static void Main(string[] args)
{//creating an object of DateTime class
//and, initializing it with the current time
//using "Now"
DateTime dt = DateTime.Now;
//getting year component
string month = dt.Year.ToString();
//printing current date & time
Console.WriteLine("Current date & time is: " + dt.ToString());
//printing the day of the week
Console.WriteLine("Year is : " + month);
//just to print a new line
Console.WriteLine();
}
}
}

Output

输出量

Current date & time is: 10/24/2019 8:08:55 AM
Year is : 2019

翻译自: https://www.includehelp.com/dot-net/datetime-year.aspx

c# datetime.

c# datetime._C#| DateTime.Year属性与示例相关推荐

  1. c# datetime._C#| DateTime.Month属性与示例

    c# datetime. DateTime.Month属性 (DateTime.Month Property) DateTime.Month Property is used to get the m ...

  2. c# datetime._C#| 带示例的DateTime.DayOfWeek属性

    c# datetime. DateTime.DayOfWeek属性 (DateTime.DayOfWeek Property) DateTime.DayOfWeek Property is used ...

  3. c# datetime._C#| DateTime.TimeOfDay属性(带示例)

    c# datetime. DateTime.TimeOfDay属性 (DateTime.TimeOfDay Property) DateTime.TimeOfDay Property is used ...

  4. c# datetime._C#| DateTime.AddTicks()方法与示例

    c# datetime. DateTime.AddTicks()方法 (DateTime.AddTicks() Method) DateTime.AddTicks() method is used t ...

  5. c# datetime._C#| DateTime.GetHashCode()方法与示例

    c# datetime. DateTime.GetHashCode()方法 (DateTime.GetHashCode() Method) DateTime.GetHashCode() method ...

  6. linux datetime,Python datetime模块示例详解

    一.datetime模块介绍 (一).datetime模块中包含如下类: 类名功能说明 date 日期对象,常用的属性有year, month, day time 时间对象 datetime 日期时间 ...

  7. python datetime datetime_Python datetime.tzinfo方法代碼示例

    本文整理匯總了Python中datetime.datetime.tzinfo方法的典型用法代碼示例.如果您正苦於以下問題:Python datetime.tzinfo方法的具體用法?Python da ...

  8. Python datetime astimezone()方法与示例

    Python datetime.astimezone()方法 (Python datetime.astimezone() Method) datetime.astimezone() method is ...

  9. Python datetime isocalendar()方法与示例

    Python datetime.isocalendar()方法 (Python datetime.isocalendar() Method) datetime.isocalendar() method ...

最新文章

  1. ScrollView嵌套ListView后,进入页面不从顶部开始显示的问题解决
  2. intellij默认maven仓库配置路径+默认New Project 工程路径
  3. Nginx + Tomcat 配置负载均衡集群
  4. nextdate函数白盒测试问题 软件测试_软件测试基本常识
  5. 精通 WPF UI Virtualization
  6. 笑喷!小区封闭男子将头伸出围栏外理发:又好笑又心酸
  7. 开环直流电机的机械特性_无刷直流电动机的开环调速机械特性研究
  8. VS2015 LINK : warning LNK4068: 未指定 /MACHINE;默认设置为 X86
  9. Julia: array =tuple, 与 ...
  10. MT4缠论公式指标(缠中狩猎外汇MT4缠论分笔分段中枢公式指标)
  11. 项目管理工具之SWOT分析法
  12. 看到一份名单发现很多公司都和自己发生了或多或少的联系
  13. Docker 问题集锦(19) - 解决:standard_init_linux.go:219: exec user process caused
  14. 初学键盘计算机输入时注意,打字练习说明.doc
  15. uAVS2 AVS2实时编码器
  16. 如何让医药行业涌现更多“药神”?
  17. 解释:什么是CPC,CPA,CVR,CTR,ROI? 营销、广告、淘宝 术语
  18. 忽尔今夏,SpringSide 3.0
  19. matlab 三维 雷达天线波束
  20. 蓝桥杯的c语言编译器,第九届蓝桥杯大赛个人赛省赛(软件类)C/C++ 大学B组比赛心得(还在更新)...

热门文章

  1. CSS中div覆盖另一个div
  2. matlab subs 慢,求助matlab程序计算速度过慢的原因
  3. php分析图片中水印的位置,关于ThinkPHP打水印及设置水印位置的分析
  4. java中number类型能否相除_Java中 如果复数类成员是int型,怎么实现两个复数相除...
  5. perl数组硬引用_Perl 继续前行,Perl 7 将是下一代(硬核老王点评版)
  6. 检测到目标url存在内部ip地址泄露_Cendertron,动态爬虫与敏感信息泄露检测
  7. 软件工程(Rational统一过程)
  8. pytorch 训练过程学习率设置衰减
  9. percona-toolkit--pt-table-checksum
  10. javascript编译压缩