Hi there,
I am wondering when creating an attribute with value timestamp, what type should i choose?
regards
Hello,
You can use either text or long integer as data type then you may need to apply some conversion to make it datetime if you will use it in your logic
Actually if you talking about Unix timestamp it is number of milliseconds since 01 January 1970
Hi,
I don't agree with this reply marked as solution, unless you need to register a timestamp with milliseconds.
OutSystems has the DateTime data type that represents a timestamp up to seconds, see:
https://success.outsystems.com/documentation/11/reference/outsystems_language/data/data_types/available_data_types/
Using the DateTime data type in OutSystems ensures that this translates to column of DateTime in MS SQL server and to a TIMESTAMP column in Oracle.
This allows to use DateTime related functions in your queries.
See for mapping of OutSystems data types to database column types here:
https://success.outsystems.com/documentation/11/reference/outsystems_language/data/database_reference/database_data_types/
Regards,
Daniel
Hi Daniel,
Would a timestamp in milliseconds, represented with a long integer, be a valid alternative if you want the timestamp to be represented in greater detail? For example, if you want to make a distinction between two records on tenths of a second?
If not, what alternative do you suggest in that case?
Thanks,
Sam
Yes of course, but I could not read from the original question that milliseconds needed to be registered.
My reply based on pervious experience while consuming API from external system and one of response JSON elements was timestamp in milliseconds.
This may be not same case for ibox question as this is not mentioned in the question.
got it, the context of milliseconds was missing in the question and your reply. I will adjust my original reply ;)
If you want tho have the date time with milliseconds I can advice this Forge component. https://www.outsystems.com/forge/component-overview/90/extended-datetime-o11
The issue with the Ousystems CurrDateTime is that this creates a new DateTime without the Miliseconds,
See OutSystems implementation.
Hello ibox,
I think it should be long integer.
Anees