"Fossies" - the Fresh Open Source Software Archive

Member "FreeBASIC-1.05.0-linux-x86_64/examples/manual/dates/dateadd.bas" (31 Jan 2016, 635 Bytes) of package /linux/privat/FreeBASIC-1.05.0-linux-x86_64.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Visual Basic source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 '' examples/manual/dates/dateadd.bas
    2 ''
    3 '' NOTICE: This file is part of the FreeBASIC Compiler package and can't
    4 ''         be included in other distributions without authorization.
    5 ''
    6 '' See Also: http://www.freebasic.net/wiki/wikka.php?wakka=KeyPgDateAdd
    7 '' --------
    8 
    9 #include "vbcompat.bi"
   10 
   11 Const fmt = "ddddd ttttt"
   12 Dim d As Double
   13 d = Now()
   14 
   15 Print "1 hour from now is ";
   16 Print Format( DateAdd( "h", 1, d ), fmt )
   17 
   18 Print "1 day from now is ";
   19 Print Format( DateAdd( "d", 1, d ), fmt )
   20 
   21 Print "1 week from now is ";
   22 Print Format( DateAdd( "ww", 1, d ), fmt )
   23 
   24 Print "1 month from now is ";
   25 Print Format( DateAdd( "m", 1, d ), fmt )