August 14, 200520 yr I have a date field, usually have to input like xx:xx in 24 hours format, can I change the input ways to xxxx in 24 hours format then system can auto turns to xx:xxAM or xx:xxPM? Thanks
August 14, 200520 yr Give this calc a whirl: Div ( GetAsNumber ( theTime ) , 3600 ) & Right("0"& Minute ( theTime ),2) --sd
August 14, 200520 yr Author Dear SD I have try your calc, but can't make it work can you give me more detail how does your calc work? I have set field"theTime" format as number, and field of Calc as Time... anything more that I should know?
August 14, 200520 yr Try this: Call your field TimeEntry I am assuming you data entry will consist of 4 numbers in the 24-hour format e.g. 1320 for 1:20PM. Set TimeEntry as a time field and then do the following Auto-entry by calculation uncheck Do not replace existing value GetAsTime(Left(Time;2) & ":" & Right(Time;2)) This converts your entry into a time and then you need to set the format on the layout to whatever you want it to look like. To have predictable results you need 4 digits.
August 14, 200520 yr You can also use Replace ( Right ( "0000" & TimeEntry ; 4 ) ; 3 ; 0 ; ":" ) This way you don't need to bother entering leading zeros.
August 14, 200520 yr Author Thank you all, really thanks the information you provide were really helpful
August 14, 200520 yr Dear SD I have try your calc, but can't make it work can you give me more detail how does your calc work? I have set field"theTime" format as number, and field of Calc as Time... anything more that I should know? My aim was to avoid the display format to follow the OS prefs. So I consider textformat as the most flexible. But the reasoning behind is that the number of seconds in one entire day is 86400 and one hour is 3600 seconds. The way filemaker stores both date and time behind the screens is for time the number of seconds from the days beginning and days after the ac/bc threshold, so today is 732172. I do beyond these fact rely on typecasts in a few places in my calc, where the "&" is dedicating the result stronger than the rest. I've taken the liberty to sus ahead that if you have an OS pref that dictatates the use AM/PM formate, would the "," be the prefered to ";" in calc although it usually on my side of the pond is ";" ...but you're in Hong Kong - which very well might be a mixture??? --sd Edited August 14, 200520 yr by Guest
Create an account or sign in to comment