Results 1 to 6 of 6

Thread: DT_GetDate

  1. #1
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    DT_GetDate

    I cant see a way to get the current date.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: DT_GetDate

    Hi Michael,

    what about Date$?
    But maybe adding DT_GetDate alias would be good choice - I was thinking about exactly the same today.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: DT_GetDate

    Thats one option I will give you that.

    I do think that the date module should also return the date.

    think Ive asked this question before
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  4. #4

    Re: DT_GetDate

    Sorry, the DT_GetDate() isn't available, but I'll add it ASAP.
    I can't figure out why it was not already developed, may be because the core module provides the DATE$ keyword.

    Regards,
    Roberto
    http://www.thinbasic.com

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: DT_GetDate

    Thanks Roberto
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #6

    Re: DT_GetDate

    Added the DT_GetDate() function to the ThinBasic's DT module

    The function can have one optional parameters (please see below for the constant value) for specify the date format requested, here is an example:

    [code=thinbasic]uses "DT"
    USES "CONSOLE"

    CONSOLE_WRITELINE("DT_GetDate(%DT_MM_DD_YY) = "+DT_GetDate(%DT_MM_DD_YY))
    CONSOLE_WRITELINE("DT_GetDate(%DT_MM_DD_YYYY) = "+DT_GetDate(%DT_MM_DD_YYYY))
    CONSOLE_WRITELINE("DT_GetDate(%DT_DD_MM_YY) = "+DT_GetDate(%DT_DD_MM_YY))
    CONSOLE_WRITELINE("DT_GetDate(%DT_DD_MM_YYYY) = "+DT_GetDate(%DT_DD_MM_YYYY))
    CONSOLE_WRITELINE("DT_GetDate(%DT_YY_MM_DD) = "+DT_GetDate(%DT_YY_MM_DD))
    CONSOLE_WRITELINE("DT_GetDate(%DT_YYYY_MM_DD) = "+DT_GetDate(%DT_YYYY_MM_DD))
    CONSOLE_WRITELINE("DT_GetDate() = "+DT_GetDate())

    CONSOLE_WRITELINE($CRLF + "Press any key to exit.")

    CONSOLE_WAITKEY

    '' Output of above code:
    '
    ''DT_GetDate(%DT_MM_DD_YY) = 04-15-09
    ''DT_GetDate(%DT_MM_DD_YYYY) = 04-15-2009
    ''DT_GetDate(%DT_DD_MM_YY) = 15-04-09
    ''DT_GetDate(%DT_DD_MM_YYYY) = 15-04-2009
    ''DT_GetDate(%DT_YY_MM_DD) = 09-04-15
    ''DT_GetDate(%DT_YYYY_MM_DD) = 2009-04-15
    ''DT_GetDate() = 04-15-2009

    ''Press any key to exit.[/code]

    You'll find this update in the next ThinBasic Release.

    Regards,
    Roberto
    http://www.thinbasic.com

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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