Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: datetostr, sounds simple....

  1. #1

    datetostr, sounds simple....

    Yeah sounds simple but something is wrong.

    I press a button which contains this>>

    Button1.caption:=datetostr(date);

    it reports the correct date. Cool.

    Then when dxdraw is initialised (DXDraw1.Initialize) the date is always reported as the day before?

    There is nothing that could do this from my code....

    WTF?

    http://forum.builder.cz/read.php?32,...467263,quote=1 <<this guy seems to have same prob

  2. #2

    datetostr, sounds simple....

    Have you tried sysutils.datetostr(sysutils.date) to see if the correct functions are called? Maybe there is an overloaded function in your framework-units which does not work correct?
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  3. #3

    datetostr, sounds simple....

    That still reports yesterday also, however:

    datetostr(now) does not. It gives correct date, so i guess I will use that

    Edit:

    oh this is impossible, now the button reports correct date, but when i ask the date to be put into a table, its still reports yesterday. whenh i dont call initialise, everything works normal

  4. #4

    datetostr, sounds simple....

    and it gets worse. Once initialise is called, my table that stores the dates is also changed. All records display the previous day, even though the data is correct.

    Ob something in sysutils is not woring right, or delphix has changed in soem way how the date is reported?

  5. #5
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2

    datetostr, sounds simple....

    The problem with dates appears to be in SysUtils.dateTimeToTimestamp.

    Before DX is initialised, it returns 732303 for the date 23/12/2005 (this is correct). Once DX has been initialised it returns 732302.

    I've uploaded my little test program here.

    The problem also affects other float to string conversions, so its not just limited to dateTimeToTimestamp. I would suggest that somewhere along the lines, DelphiX (or DirectX) is changing some processor configuration that is screwing over Delphis sysUtils.

    One thing I noticed was that this only occurs if DX7 mode is requested. I'm not sure what implications it has for performance if you turn DX7 mode off, but under those conditions, the problem doesn't occur.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  6. #6

    datetostr, sounds simple....

    Thanks for the input. Was this a fix also? Because I cannot open the exe file, it just stays minimized

    I can view source though i guess

    ahh, yes, I remember now, I added Dx7 mode again recently...and i still have 0 idea what it does anyway, so I will disable it.

    Thanks!

  7. #7
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2

    datetostr, sounds simple....

    Its not minimized..... I run at 1600x1200 and its at the bottom of the screen.... I forgot to set initial position.

    I'm not sure whether its a fix, because as I said, I don't know how turning DX7Mode off affects performance. If it forces DX7 mode when it could operate with DX8 or DX9, then I suspect you'll get a decrease in performance by leaving it on.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  8. #8
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2

    datetostr, sounds simple....

    Just had a quick read of the documentation.....

    Unfortunately, if (a) I understood the docs correctly and (b) the docs are correct, then to get hardware acceleration you have to enable DX7 mode.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  9. #9
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2

    datetostr, sounds simple....

    The problem also goes away if you turn off the do3D option...

    So, if you have do3D AND doDirectX7Mode, the problem occurs, but you'll get hardware acceleration (providing doHardware is set). As soon as you turn off do3D or doDirectX7Mode, the problem appears to go away.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  10. #10

    datetostr, sounds simple....

    So to clarify if i have do3d and do hardware I will still get hardware acceleration. And DoDX7 doesn't have much effect on anything?

    I mean, it all seems same to me on and off, on slow machines and on my own (did tests on 5 computers)

    And thanks alot for the info

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •