[lazarus] FormatDateTime()
Luis Mineiro
luis at zbit.pt
Thu Mar 27 04:26:41 EST 2003
Hi,
<snip>
Program foo;
Uses
SysUtils;
Var
S: String;
Begin
DateSeparator := '/';
S := FormatDateTime('MM/DD/YYYY', Date);
WriteLn(S);
End.
</snip>
[luis at rsmith 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
[luis at rsmith 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.
On Thursday 27 March 2003 03:28, Tony Maro wrote:
> 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.
--
Luis Mineiro (luis at zbit.pt)
ZBit Software, Lda. (http://www.zbit.pt)
More information about the Lazarus
mailing list