当前位置: 动力学知识库 > 问答 > 编程问答 >

C# DateTime.Today vs. Vb.Net Date.Today

问题描述:

I have an issue I am not sure about (hope it is not a duplicate - I didn't manage to find a answer or similar question:

I'm working with an external Webservice which I'll have to hand a kind of security code, which adds the date of today to be changed every day (for whatever reason - not my part). Well the Service is written in VB.NET, we do use C# -and my security code was wrong - that's how I found that(code below)

Well I experienced that C# DateTime.Now is like {07.02.2017 00:00:00} where as VB.NET Date.Today is like #2/7/2017 12:00:00 AM#

MSDN tells me that VB.NET Date is the equivalent to DateTime in C# so I am a bit confused MSDN Date Datatype VB.NET. Because:

c#:

"abc" + DateTime.Today + "xyz" // is "abc07.02.2017 00:00:00xyz"

VB.NET:

 "abc" + Date.Today + "xyz" // "abc07.02.2017xyz"

I mean, it is nothing I can't fix - but I'd like to know why this is different.

Thanks in advance :)

分享给朋友:
您可能感兴趣的文章:
随机阅读: