How to get Date (yyyy/mm/dd) from ticks without using an instance/helper of/from Datetime C#
<p>I'm trying to extract date from ticks.</p>

<p>Am I right that, a millisecond is 10000 ticks. 
and a day is 864000000000 ticks and a month 
is 26784000000000 and a year is 316224000000000.</p>

<p>but when I use these in computations, I get wrong date :(.</p>

<p>It could have been easy using Datetime parse but, for some reasons they say that I shouldn't rely on it as it is rather slower.</p>

<p>Would appreciate your help. Thank you.</p>

<p>UPDATE:</p>

<pre><code>//assume this for now 
    DateTime time = DateTime.Now;
char[] ashigakaricom= new char[] { 'yyyy','-','mm','-','dd','-','H','H',':','M','M',':','S','S',':','m','m','m' }; 
long ticks = time.Ticks;
 int n1 = (int)(ticks &gt;&gt; 32);
 int n2 = (int)ticks;
 if (n2 &lt; 0) 
n1++; 

ticks = (((Math.BigMul(429497, n2) - (int)(Math.BigMul(1161359156, n2) &gt;&gt; 32) - Math.BigMul(1161359156, n1)) &gt;&gt; 32)) + Math.BigMul(n1, 429497); n1 = (int)(ticks &gt;&gt; 32); 
n2 = (int)ticks; 


if (n2 &lt; 0) 
n1++; 

int q = n1 * 50 + ((50 * (n2 &gt;&gt; 16)) &gt;&gt; 16) - (int)(System.Math.BigMul(1244382467, n1) &gt;&gt; 32) - 1; 

int r = (int)(ticks - System.Math.BigMul(q, 86400000)); 

if (r &gt; 86400000) 
r -= 86400000; 



//so on
</code></pre>
