Board index » delphi » FormatDateTime('hh:mm',now);

FormatDateTime('hh:mm',now);

Hi,
Could anyone tell me why the FormatDateTime in this example returns a
time in the future(10 or 20 minutes)different to the time diplayed on
system tray?
edtTime.Text := FormatDateTime('hh:mm',now);
Thanks.
 

Re:FormatDateTime('hh:mm',now);


You FormatDateTime('hh:nn', Now) instead

PS: mm is month but not a minute

--
With best regards, Mike Shkolnik
E-Mail: mshkol...@scalabium.com
        mshkol...@yahoo.com
WEB: http://www.scalabium.com

MW <martin_maxwe...@hotmail.com> ??? a
????:4ee27cf7.0203200456.6ce6c...@posting.google.com...

Quote
> Hi,
> Could anyone tell me why the FormatDateTime in this example returns a
> time in the future(10 or 20 minutes)different to the time diplayed on
> system tray?
> edtTime.Text := FormatDateTime('hh:mm',now);
> Thanks.

Re:FormatDateTime('hh:mm',now);


In article <a7a1o5$3o...@news.lucky.net>, "Mike Shkolnik" <mshkol...@yahoo.com>
writes:

Quote
>You FormatDateTime('hh:nn', Now) instead

>PS: mm is month but not a minute

If an "h" is before an "m" then "m" is taken as a minute. An "m" after an "h"
destroys the memory of the previous "h", and any subsequent "m" is then a
month.

So  "h m m" displays "hour minute month", whereas "m h m" displays "month hour
minute", and "m m h" displays "month month hour".

Then the appropriate single/double/triple/quad format specifier is applied.

Alan Lloyd
alangll...@aol.com

Re:FormatDateTime('hh:mm',now);


Thanks for the reply and the explanation.
Doesn't that contradict the following lines copied from Delphi 5 help file ?
mm  Displays the month as a number with a leading zero (01-12). If the mm
specifier immediately follows an h or hh specifier, the minute rather than
the month is displayed.
Thanks again.
Martin.

"AlanGLLoyd" <alangll...@aol.com> a crit dans le message news:
20020320134504.08240.00000...@mb-cl.aol.com...

Quote
> In article <a7a1o5$3o...@news.lucky.net>, "Mike Shkolnik"

<mshkol...@yahoo.com>
Quote
> writes:

> >You FormatDateTime('hh:nn', Now) instead

> >PS: mm is month but not a minute

> If an "h" is before an "m" then "m" is taken as a minute. An "m" after an
"h"
> destroys the memory of the previous "h", and any subsequent "m" is then a
> month.

> So  "h m m" displays "hour minute month", whereas "m h m" displays "month
hour
> minute", and "m m h" displays "month month hour".

> Then the appropriate single/double/triple/quad format specifier is
applied.

> Alan Lloyd
> alangll...@aol.com

Re:FormatDateTime('hh:mm',now);


Thanks for the reply and the explanation.
Doesn't that contradict the following lines copied from Delphi 5 help file ?
mm  Displays the month as a number with a leading zero (01-12). If the mm
specifier immediately follows an h or hh specifier, the minute rather than
the month is displayed.
Thanks again.
Martin.
"AlanGLLoyd" <alangll...@aol.com> a crit dans le message news:
20020320134504.08240.00000...@mb-cl.aol.com...
Quote
> In article <a7a1o5$3o...@news.lucky.net>, "Mike Shkolnik"

<mshkol...@yahoo.com>
Quote
> writes:

> >You FormatDateTime('hh:nn', Now) instead

> >PS: mm is month but not a minute

> If an "h" is before an "m" then "m" is taken as a minute. An "m" after an
"h"
> destroys the memory of the previous "h", and any subsequent "m" is then a
> month.

> So  "h m m" displays "hour minute month", whereas "m h m" displays "month
hour
> minute", and "m m h" displays "month month hour".

> Then the appropriate single/double/triple/quad format specifier is
applied.

> Alan Lloyd
> alangll...@aol.com

Re:FormatDateTime('hh:mm',now);


Thanks for the reply and the explanation.
Doesn't that contradict the following lines copied from Delphi 5 help file ?
mm  Displays the month as a number with a leading zero (01-12). If the mm
specifier immediately follows an h or hh specifier, the minute rather than
the month is displayed.
Thanks again.
Martin.

"AlanGLLoyd" <alangll...@aol.com> a crit dans le message news:
20020320134504.08240.00000...@mb-cl.aol.com...

Quote
> In article <a7a1o5$3o...@news.lucky.net>, "Mike Shkolnik"

<mshkol...@yahoo.com>
Quote
> writes:

> >You FormatDateTime('hh:nn', Now) instead

> >PS: mm is month but not a minute

> If an "h" is before an "m" then "m" is taken as a minute. An "m" after an
"h"
> destroys the memory of the previous "h", and any subsequent "m" is then a
> month.

> So  "h m m" displays "hour minute month", whereas "m h m" displays "month
hour
> minute", and "m m h" displays "month month hour".

> Then the appropriate single/double/triple/quad format specifier is
applied.

> Alan Lloyd
> alangll...@aol.com

Re:FormatDateTime('hh:mm',now);


Quote
"ANNA" <ann...@fsn.net> wrote in message

news:7r8m8.22$y17.21861@news2-win.server.ntlworld.com...
Quote
> Thanks for the reply and the explanation.
> Doesn't that contradict the following lines copied from Delphi 5 help file

?

It does, but the help is wrong in this case. Use nn for minutes.

Re:FormatDateTime('hh:mm',now);


In article <nF8m8.59$y17.42...@news2-win.server.ntlworld.com>, "ANNA"

Quote
<ann...@fsn.net> writes:
>Doesn't that contradict the following lines copied from Delphi 5 help file ?
>mm  Displays the month as a number with a leading zero (01-12). If the mm
>specifier immediately follows an h or hh specifier, the minute rather than
>the month is displayed.

Only slightly - it appears (D3) that the "m" does not have to _immediately_
follow the "h", and once an "m" has followed the "h" then the "follows an "h""
mode is reset.

Most help file descriptions should be assumed to be in an unconfirmed state
until practice has ratified them <g>. What have you found in this case ?

Alan Lloyd
alangll...@aol.com

Other Threads