Recent

Author Topic: Disable localisation for FormatDateTime ?  (Read 221 times)

Nitorami

  • Hero Member
  • *****
  • Posts: 507
Disable localisation for FormatDateTime ?
« on: September 11, 2024, 04:55:39 pm »
Simple question: I am in Germany but need to FormatDateTime() to work with english month names always. Can I disable the localisation (windows) or force the language manually ? Not related to LCL, just for reading/writing text files.
« Last Edit: September 11, 2024, 05:04:13 pm by Nitorami »

Thaddy

  • Hero Member
  • *****
  • Posts: 15646
  • Censorship about opinions does not belong here.
Re: Disable localisation for DateTimeFormat ?
« Reply #1 on: September 11, 2024, 05:04:58 pm »
You can edit the FormatSettings variable (global) or simply save the formatsettings and derive from that and do it locally (TFormatSettings).
If I smell bad code it usually is bad code and that includes my own code.

Nitorami

  • Hero Member
  • *****
  • Posts: 507
Re: Disable localisation for FormatDateTime ?
« Reply #2 on: September 11, 2024, 05:09:21 pm »
I thought of this option but hoped there was a simpler way by setting a global language identifier of some sort

 

TinyPortal © 2005-2018