How to get Time with seconds and milliseconds

shibilyshibily Member Posts: 89
Hi all.

Any way to find the current Date and also the time with seconds and milliseconds.??


Thanks in advance

shibily

Comments

  • kinekine Member Posts: 12,562
    CURRENTDATETIME?

    And one thing: the time is saved internally with ms, but showed without. You need to use different formating to show them (e.g. if you move cursor to edit the time, you can see the ms...). Use FORMAT function to get full value...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • garakgarak Member Posts: 3,263
    and use the C/AL Symbol Menu (F5 in Code) here you can see all system functions like System --> Date --> Time or (CURRENTDATETIME)

    Regards
    Do you make it right, it works too!
  • shibilyshibily Member Posts: 89
    kine wrote:
    CURRENTDATETIME?

    And one thing: the time is saved internally with ms, but showed without. You need to use different formating to show them (e.g. if you move cursor to edit the time, you can see the ms...). Use FORMAT function to get full value...

    Yes, I used the function CURRENTDATETIME. However it was showing only the time and date.. If ms is also entering internally then it is fine.

    Thank you all for your support

    Shibily
  • kinekine Member Posts: 12,562
    Yes, they are. As I wrote, you just needs to move cursor to this field to see the ms part. Or change the format string to include ms too... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • jlandeenjlandeen Member Posts: 524
    Just a quick note about Date time & Time data types - both of these data types are accurate to 1/1000th of a second. However the formated output of these fields on forms & in reports does not show this detail.

    You can either use the AutoFormat Expression of the field or use the Format function to control your output.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • hrishihrishi Member Posts: 21
    so how can you get milliseconds here in the following date format

    FORMAT(DateVal,0,'<Day,2><Month,2><Year4><Hours24,2><Minutes,2><Seconds,2>')
  • hrishihrishi Member Posts: 21
    just noticed this is how it can be done
    FORMAT(CURRENTDATETIME,0,'<Day,2><Month,2><Year4><Hours24,2><Minutes,2><Seconds,2><Second dec>'));
Sign In or Register to comment.