Click here to Skip to main content
15,905,427 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Is it possible to use Big Int instead of Small Data

advantages and disadvantages

What I have tried:

C#
public long StartDate{get; set;}

public long EndDate{get; set;}
Posted
Updated 12-Aug-20 4:55am
v2
Comments
PIEBALDconsult 12-Aug-20 10:59am    
Unless your application needs to interact with a system which uses ints, you're better off using DateTime or DateTimeOffset.
Time is not an integer.

1 solution

Well ... you could ... but unless you are interested in working with dates far, far away in the future or the past it's rather pointless. And even then, absolute precision isn't feasible so that kind of temporal distance probably doesn't need a ticks count, or even days - chances are that years are going to be less useful than millenia!
So why not just store the year in a long? A C# long is a 64 bit value, so it will hold the current age of the universe in 1/100th of seconds - going to a complicated type such as BigInt seems redundant.
 
Share this answer
 
v2
Comments
PIEBALDconsult 12-Aug-20 10:56am    
I think by "big int" he meant long.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900