我如何克隆在C#DateTime对象? [英] How can I clone a DateTime object in C#?
本文介绍了我如何克隆在C#DateTime对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何在C#中克隆一个DateTime对象?
How can I clone a DateTime object in C#?
推荐答案
的DateTime是值类型(结构
)
DateTime is a value type (struct
).
这意味着下面创建一个副本:
This means that the following creates a copy:
DateTime toBeClonedDateTime = DateTime.Now;
DateTime cloned = toBeClonedDateTime;
这篇关于我如何克隆在C#DateTime对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文