Timestamp maximum date

468 views
Skip to first unread message

ChrisRoald

unread,
Nov 13, 2023, 11:35:35 AM11/13/23
to Sailforms Users
Hi, apologies if this duplicates another conversation.

I recently tried to enter a timestamp field date greater than 18-Jan-2038, which flips to year 1970! 
Am I doing something wrong, or is this the current maximum usable calendar date for a timestamp?
If it is the maximum date, is there a known workaround - other than using a text field to enter a date textually?

Thanks for your help.
C.

MikeG

unread,
Nov 14, 2023, 4:32:47 PM11/14/23
to Sailforms Users

Yes, it's the limit.  Timestamps are held as 4 byte signed integers giving the number of seconds since the start of 1970.  This can give values up to 3:14 0n 19-1-2038.


Do you really need to be using a timestamp (ie.e a field including both date and time)  when your dates may be so far into the future?


If so then you may need to hold the date and time as separate fields.  A date field should allow you dates up to 31-12-9999.


That should be OK if all you want to do is store the date/time pair.  More problems arise if you are, for example, wanting to calculate the elapsed time (not simply elapsed days) between two timestamps.  If so please let us know what you are wanting to achieve.


Mike

Reply all
Reply to author
Forward
0 new messages