在C#中获取时间戳 [英] getting timestamp in C#
本文介绍了在C#中获取时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
如果这是您需要的准确时间,您可以使用它:
日期时间刻度 [ ^ ]
如果这是某种校验和给定的对象也许你在追求
GetHashCode [ ^ ]
至于文档说所有getTimeStamp
确实返回的值是指定的列AS是sql.TimeStamp对象。 C#equivilent只会将列的值转换为所需的类型。
SQL Server中的TimeStamp通常是一个字节数组,所以....我不知道您的数据库使用了什么,因此无法准确地告诉您要使用的内容。
Hey guys, I need your help. In Java there is a way to get timestamp from a result set object and that is by using the getTimeStamp(). since I am converting to c#, the closest thing to a result set in c# is a data set, or data table. However, neither one of these posses a function similar to the getTimeStamp(). So is there a way I can do that or is there a totally different object I should use?. Thanks for your help
解决方案
If this is precise time you need you can use this:
DateTime ticks[^]
If this is some sort of checksum for a given object perhaps you're after
GetHashCode[^]
As far as the docs say allgetTimeStamp
does is return the value of the specified column AS a sql.TimeStamp object. The C# equivilent would just cast the value of of the column to the desired type.
A TimeStamp in SQL Server is usually an array of bytes, so.... I don't know what your database uses so it's impossible to tell you exactly what to use.
这篇关于在C#中获取时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文