Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time formatting

Status
Not open for further replies.

Vandelay

Programmer
Jun 22, 2003
95
US
Hi, I'm a newbie so forgive me if this is easy. I am trying to format the time field in a layout. I went to the options in the field property and set it to "hhmm" with a ":" separator. It is showing up "1535:00". I don't . I have the other settings to 'none'. I can't figure out how to make it look lik e"15:35". Got any ideas?
 
The time format will give you the outcome like you formatted the field and will not change the input form,
e.g. 15 . 32 will give 15:32
input 1532 will give 1532:00

You can use separated fields for hours and minutes and with a concatenated calculation put the two values together...

HTH

JW
 
Hi, and thanks for your response. I guess I just want the user to put in a four digit time code "1532" and have FMP re-format it to "15:32". MS Access can do this, but how do I do it in FMP?
 
You could use something in the line of :

timeOutput_ct = Time( Left( time ; 2 ) ; Right(time ;2) ; "" )

where 'time' is your timeField formatted as number.

To make sure this works, put a validation on this numberfield to make sure there are always digits in the field.
Put this field over your timeField, not enterable and out of the taborder, users will enter the value in the time field, but on the screen they will see the calc formatted.

HTH

JW
 
Well, I came up with an old calculation....

Your time input is a regular text field...

The second field, to put on top of the input field, out of the taborder and not enterable :

Time(Left(Time Input;Choose(Length(Time Input); 0; 1; 2; 1; 2));
Right(Time Input;Choose(Length(Time Input); 0; 0; 0; 2; 2))
;0)

If you enter 1345, it will show as 13:45...

HTH

JW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top