[Interest] Question about setting QLocale

Thiago Macieira thiago.macieira at intel.com
Tue Dec 1 17:13:23 CET 2015


On Tuesday 01 December 2015 15:02:49 Murphy, Sean wrote:
> Once I make that change, I only have to deal with existing files that were
> recorded under the old format where the date portion was done as "ddd
> MM/dd/yyyy". For those, it's really only the "ddd" part that is locale
> dependent and is screwing me up. That is redundant data anyways since I
> have the day, month, and year data right after it. So the easiest fix is to
> read in the string, remove the first 4 characters (the "ddd " portion) and
> then use QDateTime::fromString(data, "MM/dd/yyyy HH:mm:ss.zzz") to read
> those in.

Instead of "the first 4 characters", you should say "all the characters before 
the first space". As you saw with the Chinese case, names of the days of the 
week do not have to be 3 characters long.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list