4 Replies Latest reply on Nov 3, 2008 7:29 PM by davidanders

    Insert time in user selected format into a text field.

    rdsteele

      Title

      Insert time in user selected format into a text field.

      Post

      Using Filemaker Pro 8.5 Advanced on Macintosh.

       

      When inserting current time into a text formatted field how does one specify how the time is to be formatted? (Insert>Current Time)

      Some times time is inserted in format: hh:mm:ss AM

      and some times it is formatted as: hh:mm

      We would like to specify that the time be inserted in a 24 hour format.

        • 1. Re: Insert time in user selected format into a text field.
          Orlando
            

          Hi rdsteele,

           

          When you see the different formats of the time are they on different layouts?  

           

          Using the 'Insert > Current Time' option the time is inserted in 24 hour format, however you can change the way the time is displayed by going into layout mode, highlighting the time field and selecting 'Format > Time...'

           

          From the Time Format dialog you can select how you want the time to be displayed, Sounds like you want to 'specify Format as:' hhmm and then tick '24 hour notation'.

           

          It might be you have different time formats for the same field on differeent layouts.

           

          I hope this helps.

           

           

           

           

          • 2. Re: Insert time in user selected format into a text field.
            rdsteele
               The field that I am using "Insert Current Time" into is not a date or time field but a text field. The formatting options for time are not available in a text field.
            • 3. Re: Insert time in user selected format into a text field.
              Minami
                

              Hi rdsteele

               

              The menu command "Insert Current Time" uses current system format, or file format (its depends on File Option setting) so result is not always same for text. also the time formatting available in Layout mode won't help in this situation because the data in text field. the format only work for time/timestamp field.

               

              If you want to insert consistent format data, you need to format the data entry yourself like use Insert Calculated Result script/button, or use auto-enter field option.

              (ie.

              Let([

              Time=Get(CurrentTime) 

              H=Hour(Time); M=Minute(Time); S=Seconds(Time);

              HH=If(Length(H)=1); "0"; "") & H; 

              MM=If(Length(M)=1); "0"; "") & M; 

              SS=If(Length(S)=1); "0"; "") & S]; 

              HH & ":" & MM & ":" & SS)
               

               

              • 4. Re: Insert time in user selected format into a text field.
                davidanders
                  

                Change the Time Text field to a Time Time field. 

                Set the Time Text field to a button, that when clicked will run script to use Hour(Time) and Minute(Time) to set the text field to current time.

                Set the Time Text field to a calculation that is not modifiable with a Time Field underneath that will take the current time and is calculated into the Time Text field.

                Those are the easiest, and depending on what use you are going to put the field to...