# Date format on export different on different machines (with identical setups)

**URL:** <https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612>\
**Category:** Support\
**Tags:** odk-briefcase, odk-collect\
**Created:** [June 18, 2018, 5:36pm UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612 "2018-06-18T17:36:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_michaelmarks](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/dr_michaelmarks/32/1772_2.png) [@dr\_michaelmarks](https://forum.getodk.org/u/dr_michaelmarks)\
**Post date:** [June 18, 2018, 5:36pm UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/1 "2018-06-18T17:36:55Z")

</div>

Myself and a colleague download data from the same server.  
We both do this using a command line script which calls Briefcase (so our call to Briefcase and all settings are identical). We both have the same date and time settings on our devices which are both macs.

But my dates (for example a TODAY field) come out as DD-MMM-YYYY and his come out DD MMM YYYY  
This is then problematic for pre-scripted analyses we are both running.

Not sure if this is because the data is not stored as an ISO date field, if there is a way of specifying the format for dates at export etc but resolving this would be valuable

---

<div class="post-metadata">

**Author:** ![ggalmazor](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ggalmazor/32/2702_2.png) [@ggalmazor](https://forum.getodk.org/u/ggalmazor)\
**Post date:** [June 18, 2018, 10:36pm UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/2 "2018-06-18T22:36:13Z")

</div>

Hi @dr_michaelmarks!

Briefcase doesn't store any data (it just reads the XML form submissions) and, therefore, it depends on its source.

While exporting submissions to CSV, though, it reads date/time data and it generates a string representation using [Java's MEDIUM style pattern](https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html) which depends on the system's Locale settings. Taking this into account, what you describe is what can be expected: if two computers have different locale settings, Briefcase will probably produce different date/time strings.

I personally think that Briefcase should export date/time fields to [ISO8601 format](https://en.wikipedia.org/wiki/ISO_8601), which doesn't depend on the system's locale. The ISO8601 format is a standard and it's supported by most of the spreadsheets apps, analytics software, and databases. Would that work in your case?

---

<div class="post-metadata">

**Author:** ![dr\_michaelmarks](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/dr_michaelmarks/32/1772_2.png) [@dr\_michaelmarks](https://forum.getodk.org/u/dr_michaelmarks)\
**Post date:** [June 19, 2018, 6:30am UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/3 "2018-06-19T06:30:19Z")

</div>

1. I agree an ISO export of dates would be helpful

2. BUT the issue is a bit weirder than that

- We are both running our machines in the UK
- Same operating system
- Same clock settings (i.e if we click the Date/Time trop right on mac screen they both display the date as DD MMM YYYY
- Same advanced Date/Time display settings in preferences
- ![34](https://getodk.b-cdn.net/uploads/default/original/2X/8/80980897a167bac726c0f96b6841b531c1cfb68f.jpg)

So it is not clear to me that we have different locale settings (and if we do it must be hidden away somewhere)  
Note that dates are both DD MMM YYYY just that one machine is adding hyphens to the CSVs

---

<div class="post-metadata">

**Author:** ![ggalmazor](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ggalmazor/32/2702_2.png) [@ggalmazor](https://forum.getodk.org/u/ggalmazor)\
**Post date:** [June 19, 2018, 8:25am UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/4 "2018-06-19T08:25:59Z")

</div>

Wow, that's weird!

I'm going to ask an obvious question (sorry!): did you check the outputs it in a plain text editor? If you used apps like Excel you might be seeing differences due to user customized preferences...

---

<div class="post-metadata">

**Author:** ![ggalmazor](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ggalmazor/32/2702_2.png) [@ggalmazor](https://forum.getodk.org/u/ggalmazor)\
**Post date:** [June 19, 2018, 8:33am UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/5 "2018-06-19T08:33:40Z")

</div>

@dr_michaelmarks, one test to completely rule out different locales as the source of your issue is to run Briefcase with some JVM args to force a specific locale settings like this:

`java -Duser.country=GB -Duser.language=en -jar briefcase.jar`

This will force the `en_GB` locale on the running Java program.

Then, compare the outputs using a plain text editor.

(I originally posted this on the wrong post, sorry about that!)

---

<div class="post-metadata">

**Author:** ![dr\_michaelmarks](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/dr_michaelmarks/32/1772_2.png) [@dr\_michaelmarks](https://forum.getodk.org/u/dr_michaelmarks)\
**Post date:** [June 19, 2018, 9:43am UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/6 "2018-06-19T09:43:54Z")

</div>

Interesting we will try this.

Is there a list of locales anywhere?

---

<div class="post-metadata">

**Author:** ![ggalmazor](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ggalmazor/32/2702_2.png) [@ggalmazor](https://forum.getodk.org/u/ggalmazor)\
**Post date:** [June 19, 2018, 10:01am UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/7 "2018-06-19T10:01:31Z")

</div>

Sure!

Country codes are defined in the [ISO 3166-2 standard](https://en.wikipedia.org/wiki/ISO_3166-2) and language codes use the [ISO 639-1 standard](https://www.wikiwand.com/en/List_of_ISO_639-1_codes).

Locales are often represented by a string combining the language code and the country code like this: `en_GB`

---

<div class="post-metadata">

**Author:** ![dr\_michaelmarks](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/dr_michaelmarks/32/1772_2.png) [@dr\_michaelmarks](https://forum.getodk.org/u/dr_michaelmarks)\
**Post date:** [June 19, 2018, 6:25pm UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/8 "2018-06-19T18:25:12Z")

</div>

Sadly this did not fix it  
We now run a scripted call to briefcase (its shared script so we are running the exact identical file)  
We include a specific setting to make locale = GB

my dates in text editor still appear DD-MMM-YYYY, colleagues DD MMM YYYY

---

<div class="post-metadata">

**Author:** ![ggalmazor](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ggalmazor/32/2702_2.png) [@ggalmazor](https://forum.getodk.org/u/ggalmazor)\
**Post date:** [June 20, 2018, 7:19am UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/9 "2018-06-20T07:19:25Z")

</div>

Hi, @dr_michaelmarks!

This is another level of weird 😮

I guess the answer is "yes" but, I forgot to ask another obvious question: are you both exporting the same form?

Also, could you run the command `java -version` in both machines and copy here the output, please?

---

<div class="post-metadata">

**Author:** ![dr\_michaelmarks](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/dr_michaelmarks/32/1772_2.png) [@dr\_michaelmarks](https://forum.getodk.org/u/dr_michaelmarks)\
**Post date:** [June 20, 2018, 7:30am UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/10 "2018-06-20T07:30:45Z")

</div>

We can check the Java version.  
Its a scripted call to briefcase which pulls the same set of forms on both computers.

---

<div class="post-metadata">

**Author:** ![ggalmazor](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ggalmazor/32/2702_2.png) [@ggalmazor](https://forum.getodk.org/u/ggalmazor)\
**Post date:** [June 20, 2018, 7:50am UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/11 "2018-06-20T07:50:53Z")

</div>

Thanks! I'm interested especially in knowing if you're both running Oracle/OpenJDK or any other vendor's JVM.

I've prepared a Java class that tests different ways of formatting dates related to how Briefcase does it. It would let me know if the Java environments are different. Could you run it on both computers and copy here the results as well, please?

[DateTest.zip](https://getodk.b-cdn.net/uploads/default/original/2X/b/b9354a0d62605cda18cbb312ba8f819f1b426715.zip) (1004 Bytes)  
You need to unzip it and launch it with `java DateTest`. In my computer I get this output:

```auto
Date (no args) : Jun 20, 2018
Date DEFAULT style : Jun 20, 2018
Date MEDIUM style : Jun 20, 2018
Date DEFAULT en_GB : Jun 20, 2018
Date MEDIUM en_GB : Jun 20, 2018
LocalDate MEDIUM : Jun 20, 2018

```

---

<div class="post-metadata">

**Author:** ![dr\_michaelmarks](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/dr_michaelmarks/32/1772_2.png) [@dr\_michaelmarks](https://forum.getodk.org/u/dr_michaelmarks)\
**Post date:** [June 20, 2018, 10:07pm UTC](https://forum.getodk.org/t/date-format-on-export-different-on-different-machines-with-identical-setups/13612/12 "2018-06-20T22:07:05Z")

</div>

Ok well this has definitely flagged a difference!

COMPUTER 1:  
 ![46](https://getodk.b-cdn.net/uploads/default/original/2X/5/53d6222fdb1833e68ff6413167affd9600a0acc2.png)

 ![27](https://getodk.b-cdn.net/uploads/default/original/2X/8/8a9b51db4759de7abc5a7773c9e342e1e241298e.png)

COMPUTER 2:

![41](https://getodk.b-cdn.net/uploads/default/original/2X/9/90dd0e41392980112ac1ef0ee165c5d39a94f3ec.png)

 ![01](https://getodk.b-cdn.net/uploads/default/original/2X/3/375d46cc89445485763b6b7680a67c68308219aa.jpg)

I then completely removed Java on computer 1 and installed JDK 10.01 - Hyphens gone, problem fixed.

**But more broadly and from an ODK Feature perspective we need a solution whereby all dates come out in ISO format as mentioned above to avoid this kind of issue - real barrier to pre-scripted analysis**
