Page 1 of 1
Issue with #date webtag and date in CMX
Posted: Sun 20 Aug 2023 10:46 am
by broadstairs
I have been chasing an issue with my test CMX website where the date is not showing correctly, it shows 1Jan 1970. I have found that the #date tag contains the USA format of 8/20/2023 and this shows as the date in the log file as well. Now I have CMX set to use the locale default which is set yo British and data in the data files is correct but for instance the selection date which comes up in Data Log Viewer is the USA format. So it seems to me that the locale processing is not correct at least on my system. I've double checked my date settings in both CMX and the system and everything else shows as per locale, and I tried a restart of CMX but still does it! I'm using b3248.
Anyone any ideas please?
Stuart
Re: Issue with #date webtag and date in CMX
Posted: Sun 20 Aug 2023 12:35 pm
by mcrossley
If you look at the start of your MXdiags log files, it will record the locale there...
Code: Select all
2023-08-09 12:00:02.538 Current culture: English (United Kingdom) [en-GB]
Re: Issue with #date webtag and date in CMX
Posted: Sun 20 Aug 2023 12:47 pm
by broadstairs
Mine says
Code: Select all
2023-08-20 11:19:05.117 Current culture: English (United States) [en-US]
cmx.png
Stuart
Re: Issue with #date webtag and date in CMX
Posted: Sun 20 Aug 2023 1:00 pm
by mcrossley
So the context MX is running under is US. The current user and system can normally have different locales - for instance Windows "system" defaults to US even if your user is set to GB; though I always change both to GB.
If you are running MX as a service, which user context is it using? (Implication: what locale is set for that user)
You can always override the user context by specifying the parameter "-lang en-GB" on the MX command line.
As you note though, if MX has been running under a US locale all your log files will also have US format dates in them, you will need to convert them manually so MX can read them under the new locale.
Re: Issue with #date webtag and date in CMX
Posted: Sun 20 Aug 2023 9:37 pm
by broadstairs
Mark I have stopped the service and started CMX manually with the -lang parm and my dates are correct. However the strange thing is that I have been back through the log files in the data directory to where I thing this started and none of them have the wrong format dat in them, they are all correctly showing dd/mm/yyyy! So the issue with running as a service is that the only issue I can see is what is shown in the mxdiags log and the #date webtag! The .service file has my user and group names rather that root defined.
Stuart
Re: Issue with #date webtag and date in CMX
Posted: Sun 20 Aug 2023 10:16 pm
by mcrossley
Yes, sorry I was wrong about the log file dates. US and GB are similar enough in most of the things that matter to log files - date separators, dot decimals, and list separators. The date order in the log file is fixed - dd, mm, yy - but the separator is taken from the locale.
Re: Issue with #date webtag and date in CMX
Posted: Mon 21 Aug 2023 8:52 am
by broadstairs
I now have it running again as a service this time having set (or attempted to set) global locale and now shows as running correctly with
Code: Select all
Current culture: English (United Kingdom) [en-GB]
and my dates are showing correctly
Stuart
Re: Issue with #date webtag and date in CMX
Posted: Mon 21 Aug 2023 3:28 pm
by mcrossley