function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Santosh UppalaSantosh Uppala 

convert c# ticks method to apex

Hi All,
I am trying to convert c# ticks mehtod of datetime in apex. Document says that getime() method will work as ticks method of C#, but when i try to compare both results its coming different. So can any who is familiar with it help me on it?
Here is the code.
C#:
long time = DateTime.Now.Ticks;
Console.WriteLine(time);
O/P : 636297691874640148

Apex Code:
DateTime dt = system.Now();
 long ticks = dt.getTime(); 
O/p : 1494165245354

As you can see above there is a difference in the output. So please let me know where i am doing a mistake.

Thanks in Advance !!