What I really want to do is convert DateTime.Now.Ticks to the shortest possible string without losing any precision. How is this possible? Let’s assume we’re using 7bit ASCII character set.
What I really want to do is convert DateTime.Now.Ticks to the shortest possible string
Share
I would use
System.BitConverterto convert the long to a byte array, thenSystem.Convert.ToBase64String. You can reverse it with corresponding methods on both classes.