54
Views
8
Comments
Solved
What type should be used for timestamp?
Application Type
Traditional Web, Mobile, Reactive, Service

Hi there,

I am wondering when creating an attribute with value timestamp, what type should i choose?

regards

2020-11-25 10-45-32
Mostafa Othman
Champion
Solution

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

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

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

2024-02-27 12-57-22
Sam Rijkers
Solution

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

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

Yes of course, but I could not read from the original question that milliseconds needed to be registered.

2020-11-25 10-45-32
Mostafa Othman
Champion

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.

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

got it, the context of milliseconds was missing in the question and your reply. I will adjust my original reply ;)

2023-02-09 12-36-42
Damian Fonville
Solution

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.

2024-02-27 12-57-22
Sam Rijkers
Solution

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

2025-09-21 06-51-05
Mohd Anees Mansoori

Hello ibox,

I think it should be long integer.

Regards,

Anees

2020-11-25 10-45-32
Mostafa Othman
Champion
Solution

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

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

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

2024-02-27 12-57-22
Sam Rijkers
Solution

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

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

Yes of course, but I could not read from the original question that milliseconds needed to be registered.

2020-11-25 10-45-32
Mostafa Othman
Champion

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.

2024-07-05 14-16-55
Daniël Kuhlmann
Ā 
MVP

got it, the context of milliseconds was missing in the question and your reply. I will adjust my original reply ;)

2023-02-09 12-36-42
Damian Fonville
Solution

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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.