Subject: RE: Using TimeDifference with 12h and 24h format
The problem you describe, I’m not sure whether it’s what’s actually happening, or whether you are just afraid it might happen.
Is fl_time a date/time value, or is it text? If it’s text, you’re in trouble. Never, ever, ever, store a date/time value as text, because different systems (and users in different countries) will interpret that text differently. Without knowing the settings of the system that stored the value, it is impossible to tell what time was intended.
If you store a date/time value properly, as a date/time field, it’s stored as numbers of seconds since a fixed reference date/time. This is independent of how it’s converted to text for display. All computers can agree on what time it represents, even though they would display the time differently.
It’s just like number fields. If you store a string, “7,000” means 7 to some systems and 7000 to others. But if you use a number field, it’s the same number to everyone and you can do math without caring whether the computer uses “.” or “,” as a decimal separator.
The NotesDateTime class operates on date/time values in this way. It doesn’t need to know how the date is formatted for display, to do math on it. But you must give it good input. If you pass the constructor a text string that was generated by another computer, it will try to interpret that string using the settings of the current computer.
N.B. that just because a field is defined as date/time on a form, doesn’t mean that a date/time value is necessarily stored in documents. It depends how the field gets assigned, whether thru code or what. Use the document properties from a view to check the real datatype of the item.