I encountered the same problem a while back.
No native way to solve this as I'm aware.
It all depends in what situation you require the stamp and what version of FM you are using; developing in FM Pro allows you to create Custom Functions.
In my case a requirement was to store a time stamp when a certain script was executed. When that script is executed I call a custom function improvedTimestamp() to be stored in a field.
Fieldname = improvedTimestamp()
Function defined as:
If (Length ( GetAsTime(Get(CurrentHostTimeStamp))) = 5; GetAsTime(Get(CurrentHostTimeStamp)) & ":00"; GetAsTime(Get(CurrentHostTimeStamp)))
If you are not working with a FM Pro version you can create a calculated field, called say
cImprovedTimestamp = If (Length ( GetAsTime(Get(CurrentHostTimeStamp))) = 5; GetAsTime(Get(CurrentHostTimeStamp)) & ":00"; GetAsTime(Get(CurrentHostTimeStamp))) that field will now contain the current timestamp with 00 seconds.
Thank you for your answer.
What you write helps; my situation is pretty much the same: When a certain script action is being performed I need to get a timestamp (in this case for a history field that lists the actions of the records).
Though my problem is a bit more of an "aesthetic" issue, the users would find it awkward if some zeroes don't show up in their records' history fileds:
29.01.2011 00:59:33 John Baker: Request filed.
29.01.2011 01:08:30 John Baker: Request changed.
29.01.2011 01:09 Tom Smith: Request changed.
29.01.2011 01:19:49 Colin Scott: Request approved.
I am still unclear if your version of FM allows you to create custom functions?
Are you explicitly stamping the date using GetAsTime(Get(CurrentHostTimeStamp))?
When and what is currently stamping the date? You by script or calculated field, or are you using a native function to do this?
If you are using GetAsTime(Get(CurrentHostTimeStamp)) to append or write to a field, and you are using FM Pro, create a custom function using the code I provided in the above post.
In place of using GetAsTime(Get(CurrentHostTimeStamp)) call the custom function and the two zeros will be appended.
Sorry for not having been clearer.
Yes, I use FM Advanced an can create custom functions. Here is the one the I called ImprovedTimestamp:
ITS = Get ( CurrentHostTimestamp )
Length ( GetAsTime ( ITS ) ) = 5; GetAsDate ( ITS ) & " " & GetAsTime ( ITS ) & ":00" ;
GetAsDate ( ITS ) & " " & GetAsTime ( ITS )
The timestamp formatted this way is being set when a script runs it.