[lazarus] FormatDateTime()

hernan.et at pg.com hernan.et at pg.com
Thu Mar 27 17:48:55 EST 2003

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.



 Internet Mail Message                                          
 Received from host:                                            

From: Luis Mineiro <luis at zbit.pt> on 03/27/2003 09:46 AM GMT
         Luis Mineiro           To:   lazarus at miraclec.com                 
       <luis at zbit.pt>           Cc:    (bcc: Yoyong Hernan-ET/PGI)         
                        Subject:      Re: [lazarus] FormatDateTime()       
  03/27/2003 05:46 PM                                                      
    Please respond to                                                      
 lazarus at miraclec.com                                                      


Program foo;
        S: String;
        DateSeparator := '/';
        S := FormatDateTime('MM/DD/YYYY', Date);

[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

DateSeparator (declared in SysUtils), like in Delphi/Kylix, is a variable for
locale specific functions that use dates.

There are others: DecimalSeparator, etc.


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:
> 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)

     To unsubscribe: mail lazarus-request at miraclec.com with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

More information about the Lazarus mailing list