Repository navigation
Isdate
Home › Date and Time Functions › IsDate
Returns true if the text can be read as a date in the system's date format.
Declare Function IsDate ( ByRef stringdate As Const String ) As Longstringdate
Date strings must be in the format set in the regional settings of the OS to be considered valid dates.
IsDate(Date) will return non-zero (-1) only if the regional settings specify the same date format that QB used.
The compiler will not recognize this function unless vbcompat.bi or datetime.bi is included.
Returns non-zero (-1) if the date string can be converted to a Date Serial, otherwise returns zero (0).
#include "vbcompat.bi"
result = IsDate( stringdate )- New to FreeBASIC
#include "vbcompat.bi"
Dim s As String, d As Long
Do
Print
Print "Enter a date: "
Line Input s
If s = "" Then Exit Do
If IsDate( s ) = 0 Then
Print "'"; s; "' is not a valid date"
Else
d = DateValue( s )
Print "year = "; Year( d )
Print "month = "; Month( d )
Print "day = "; Day( d )
End If
LoopCategory: Date and Time Functions
Kind: function
Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Lambdas
- Block Strings
- Partial Types
- String Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- PsControls
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing