Hi,
I search forum I got this awesome link
I need to get the time upto milliseconds.
how can I get? give me some suggestion.
Thanks in advance,
thenndral
Solved! Go to Solution.
Solved by thenndral. Go to Solution.
It's pure .Net question, please post this kind of non-Autodesk related topic to general purpose forums.
Check the DateTime.Milliseconds property if this is what you are asking for.
http://msdn.microsoft.com/en-us/library/system.datetime.aspx
Thank you,
Philippe.
Hi,
Thanks philippe.leefsma.
I found the solution.
It May be useful for someone.
double get_sec = tmp_db.Tdcreate.ToOADate() + 2415018.5; int dt_mil = ConvertMillisecond(get_sec);
private int ConvertMillisecond(double julianDate) { int date; try { double mil = 0; double time = (julianDate - Math.Floor(julianDate)) * 86400; double mm = Math.Floor(time / 60); mil = time - (mm * 60); double result = Math.Round(mil, 3, MidpointRounding.AwayFromZero); string[] s = result.ToString().Split('.'); string res = s[1]; //date = new DateTime(year, month, day, Convert.ToInt32(hours), Convert.ToInt32(minutes), Convert.ToInt32(seconds), Convert.ToInt32(res)); int date1 = Convert.ToInt32(res); return date1; } catch (ArgumentOutOfRangeException ex) { AcadApp.ShowAlertDialog("Julian date could not be converted:\n" + ex.Message); date = 0; } catch (Exception ex) { AcadApp.ShowAlertDialog("Error converting Julian date:\n" + ex.Message); date = 0; } return date; }
Thanks again,
Thenndral
Thanks for Sharing Thenndral!
Please do understand that we need to restrict our support to Autodesk specific related questions, we could be overflooded with general programming questions otherwise.
Regards,
Philippe.