6 Replies Latest reply: May 15, 2014 10:06 AM by cferguso _ RSS

    Change Date Format

    cferguso _

      Is there a way to change the date format from "mm/dd/yyyy" to "mm/dd/yy"?

        • Change Date Format
          Data Kruncher

          The only way that I see to do this is by creating a Character field with:

          Left(DtoC(MyDate),len(DtoC(MyDate))-4)+right(DtoC(MyDate),2)[/CODE]

           

          I even tried changing the regional setting in the Control Panel for how dates are displayed. Maybe I should have rebooted after changing from m/d/yyyy to m/d/yy. :confused: It didn't seem to do anything within the test model, after applying the Control Panel change and then reopening the test Monarch session.

           

          Not sure if that'll help you though.

          • Change Date Format
            Grant Perkins

            Is there a way to change the date format from "mm/dd/yyyy" to "mm/dd/yy"?[/quote]

             

            Where do you need to do this? Input or export?

              • Change Date Format
                cferguso _

                I need to export

                  • Change Date Format
                    Olly Bond

                    Hello cferguso,

                     

                    I think you'll need to change your Regional Settings in the Control Panel in Windows to make your dates export in a different format. You can create a text field that mimics the date format you want using DataKruncher's formula, but that will only work if you're exporting to text or CSV, and if the export file is being read in either by Monarch or on a machine with appropriate regional settings.

                     

                    How dates are displayed, and exported, is set deep within Windows. Monarch will let you set the format for reading in dates from text reports, however...

                     

                    Best wishes,

                     

                    Olly

                      • Change Date Format
                        Grant Perkins

                        Dates, as displayed, are most often a function of the display format selected on the system displaying them. The underlying common data structure should, at least in theory, allow the date and time to be displayed in any chosen, compatible format.

                         

                        If you are exporting as a text report you probably need to use Kruncher's formula or something like it (there are usually several ways to get to a result in Monarch) but if you expoerted file is to be displayed in another application that reads the field as a date it seems likely that setting the required display format in that application should, with luck, give you what you require.

                         

                        I say 'with luck' because not all applications seem to pay solid attention to such matters as common data handling.

                         

                         

                        HTH.

                         

                         

                        Grant