Recent

Author Topic: [RESOLVED]Conversion error due to wrong date format.  (Read 2620 times)

Soner

  • Sr. Member
  • ****
  • Posts: 305
[RESOLVED]Conversion error due to wrong date format.
« on: February 16, 2018, 02:13:04 pm »
I have compiled my programm on mac now I get conversion error due to wrong date format.
OS has german locale settings (dd.mm.yyyyy) but lazarus app shows in calendars mm.yy.yyyy format also strtodate gives conversion error.

How can my program take system date format settings?
« Last Edit: February 16, 2018, 07:03:40 pm by Soner »

RayoGlauco

  • Full Member
  • ***
  • Posts: 179
  • Beers: 1567
Re: Conversion error due to wrong date format.
« Reply #1 on: February 16, 2018, 03:37:14 pm »
In SysUtils unit, there is a variable named FormatSettings, whose values are determined automatically from the locale settings of the computer when the program is started.

You should take a look at this: https://www.freepascal.org/docs-html/rtl/sysutils/tformatsettings.html

To err is human, but to really mess things up, you need a computer.

Soner

  • Sr. Member
  • ****
  • Posts: 305
Re: Conversion error due to wrong date format.
« Reply #2 on: February 16, 2018, 07:03:27 pm »
@RayoGlauco
I did so, but I wanted Systemsetttings.


Now I found the solution.
If someone has same problem look here:
http://wiki.lazarus.freepascal.org/OS_X_Programming_Tips#Locale_settings_.28date_.26_time_separator.2C_currency_symbol.2C_....29

 

TinyPortal © 2005-2018