8 Replies Latest reply on Jun 3, 2015 6:19 AM by malachydevlin

    system formats

    malachydevlin

      Hi, I haven't come across this before as all my clients are in the UK however I have one client in the US who opens my file and gets the usual question about system formats etc.

      My query is that I am not sure if either of these choices affects the dates already entered.

      e.g I have a date in my settings file in UK format (its an expiry date) and the startup script checks if that date is now reached (based on the get(currentdate).

      what would be the correct way around this?

        • 1. Re: system formats
          mikebeargie

          It might be wise if you're on two continents to start using Get(CurrentTimeUTCMilliseconds) as a more accurate comparison. Then you can translate that value into the display and functions you need. UTC time is not affected by format or timezones, so it's more sacrosanct than date/time stored by a user's setting.

          • 2. Re: system formats
            malachydevlin

            thanks, does the data entered in the browse mode date fields change format to US also?

            • 3. Re: system formats
              DavidJondreau

              I wouldn't say it's more accurate...That function uses the client's clock, not the host clock. I don't know how it figures the timezone. That's an interesting question.

               

              If "absolute" time is required, use Get ( CurrentHostTimestamp ). If "local" time is required, I recommend a custom function that takes host timestamp and modifies it based on the timezone (which you can calculate using UTC and regular Get ( CurrentTime).

              • 4. Re: system formats
                siplus

                I agree a lot with David.

                 

                Get(CurrentHostTimeStamp) is a must in every solution that requires control over amendment to historical data.

                 

                Every bozo can modify his own computer's clock (and date setting), allowing him to alter old data as problems arise with the decisions made in the past. Using exclusively the server's clock setting is a wise decision.

                 

                In our medical solutions we only allow changes to data "born" today. Implementing the law, nothing more.

                • 5. Re: system formats

                  There are some excellent recommendations here and I would like to add one that does not answer the question but will help you discover an answer for yourself.

                   

                  Set up a layout for user testing that will be just that and different users in different locations can tell you what happens there. You will have many devices hitting your databases and may find that PC brands make a difference plus how the user sets up his computer as siplus mentioned about user's changing their clocks (daylight standard time for instance).

                   

                  You could set up a calculation to enter one time into the various fields and ask how the users see it. Note that one good idea is to create a calculation field that would display it in text such as Thursday, December 10, 2015 and FileMaker offers a format for the date field that does that.

                   

                  Keep in mind that there are many different 'calendars' that start from different time periods, etc. but we won't worry about in this post.

                   

                  Consider just three types of dates: Military, US and European. Not an exact naming of course.

                   

                  Military: 2015.12.10

                  US:  12.10.2015

                  Euro: 10.12.2015

                  Verbal: Thursday, December 10, 2015

                   

                  It would be a valuable idea to add a duplicate of the field set for not enterable and have it show the text date alerting people f a different date format that might have been used. And showing the four formats as I have done can be helpful.

                   

                  Since you can hide/show fields in 13 and 14 you can let the user select the format for date entry and stack the fields on top of each other showing A if $$FieldType = US or B if $$FieldType = Euro  and so on. This default can be set on startup.

                   

                  Now you don't have to worry about this as the user will make their selection and FileMaker will handle the date internally for you.

                   

                  Of course the best solution is to use popups for the date and month and year and only offer 1-12 for month, 1-31 for day, etc.

                   

                  Keep in mind that a laptop with one of the 9 types of FIleMaker installations based on language can be used anywhere in the world... Yikes...

                   

                  Thus my suggestion is to not try to control this yourself but to let the users decide for themselves and for you to accomodate their preference. Someone will open a Japanese version of FIleMaker on a Windows OS running a European version of the OS in the United States... 

                  • 6. Re: system formats
                    malachydevlin

                    thanks to all for this, having studied it I have found that what will solve my specific query is:

                    I have 2 dates and I need them in the same format so I can compare if one is the same as the other.

                    1 - is simply Get (CurrentDate)

                    2 - is a UK date stored in my database configuration.

                     

                    so is there a way

                    if I can use a calculation to take

                    Get (CurrentDate) and convert it into UK format?

                     

                    cant figure it out, I am thinking of using dayofyear() to compare the days simply as that should work no matter the date format

                    • 7. Re: system formats
                      siplus

                      getasnumber(date1) = getasnumber( date2) should fit your bill.

                      • 8. Re: system formats
                        malachydevlin

                        yes it does! great solution..