[DateUtils] Why text output?

[DateUtils] Why text output?

  
Forge Component
(2)
Published on 2015-12-15 by Pedro Domingues
2 votes
Published on 2015-12-15 by Pedro Domingues
Why is this outputting text for CurrDateTimeMS() instead of a DateTime type? Is there something I shoul know before adding a function that does it in DateTime type?

J.Ja
Solution
DateTime type does not include the miliseconds resolution.

I'd say that's the reason for returning text.

Solution
Joel Alexandre wrote:
DateTime type does not include the miliseconds resolution.

I'd say that's the reason for returning text.
 
I forgot that DateTime doesn't really have MS (they are in the DB, but not really used). I think you're right here. 

J.Ja

Actually the datetime datatype does keep the milliseconds, just the Text conversions do not print them.

Comparisons will still work and if you send the value to the database or to an integration (SOAP, REST, extension, ... ) the milliseconds will be sent as well.

Also in the next major version of the platform there will be a new Builtin function (that will replace around 8 of the existing functions) for date time format to text that will allow printing the milliseconds.

Regards,
João Rosado