I tried that one is a Lazarus project but I does not work. The scope of DateSeparator is global, right? So I changed it in FormCreate to DateSeparator : = '/' but it does not work.
Regards,
Yoyong
Internet Mail Message
Received from host:
svcr-216-37-230-2.dsl.svcr.epix.net
[216.37.230.2]
From: Luis Mineiro on 03/27/2003 09:46 AM GMT
Luis Mineiro To:
Cc: (bcc: Yoyong Hernan-ET/PGI)
Subject: Re: [lazarus] FormatDateTime()
03/27/2003 05:46 PM
Please respond to
Hi,
<snip>
Program foo;
Uses
SysUtils;
Var
S: String;
Begin
DateSeparator := '/';
S := FormatDateTime('MM/DD/YYYY', Date);
WriteLn(S);
End.
</snip>
toaster]$ fpc foo.pp
Free Pascal Compiler version 1.1 [2003/03/26] for i386 Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: Linux for i386
Compiling foo.pp
Linking foo
10 Lines compiled, 0.1 sec
toaster]$ ./foo
03/27/2003
DateSeparator (declared in SysUtils), like in Delphi/Kylix, is a variable for locale specific functions that use dates.
There are others: DecimalSeparator, etc.
Cheers.
Tony Maro wrote 13 lines
Can anyone help me figure out why:
FormatDateTime('MM/DD/YYYY', ThisDate)
always results in something looking like:
MM-DD-YYYY
It replaces my chosen slash with a dash.
That's fine for you foreigner's, but us warmongering Americans like
slashes in our dates. ;-)
I know it's an FPC and not a Lazarus question, just wondering if someone
knows an easy workaround. So far I'm having to manual separate out a
date and reconstruct it myself to get what I want.