is there easy way to store dates as number and convert number to date equivalent in .NET 3.5 such as julian date format?.
+4
A:
You can use DateTime.Ticks to convert a DateTime to a number (more specifically - a long). Use the constructor that takes ticks to convert back.
Mark Byers
2010-10-13 08:00:42
+1
A:
This should work fine for you
DateTime date = DateTime.Now;
long dateAsLong = date.ToFileTime();
DateTime orgDate = DateTime.FromFileTime(dateAsLong);
Dennis
2010-10-13 08:07:45
+3
A:
DateTime.ToOADate() → double → DateTime.FromOADate()
DateTime.ToFileTime() → long → DateTime.FromFileTime()
DateTime.ToFileTimeUtc() → long → DateTime.FromFileTimeUtc()
All of these methods will convert a DateTime to a numeric.
Paul Ruane
2010-10-13 08:10:24
A:
Time Tick gives a big number with lot of zeros so its not suitable for asp.net query string parameter values but might work for some other situations.So julian date conversions are the most easy and nice way to use in asp.net query string date value passing between pages
DSharper
2010-10-13 11:19:15