How to maintain precision using DateTime.Now.Ticks in C#
- by nmr
I know that when I use DateTime.Now.Ticks in C# it returns a long value but I need to store it in an int variable and I am confused as to whether or not I can maintain that precision. As of right now I just have a cast
int timeStampValue = (int)DateTime.Now.Ticks;
Any suggestions or advice on how to maintain the precision, if possible, would be much appreciated.