1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-26 15:35:53 +00:00
QB64-PE/internal/help/DATE$_(statement).txt
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

48 lines
1.8 KiB
Plaintext

The '''DATE$''' statement sets the current computer date to another [[STRING]] value.
:::''Syntax:'' DATE$ = String_expression
* String expression can use slash or dash formats when assigning the date:
::::mm-dd-yyyy
::::mm/dd/yyyy
* String expression or variable must contain the months, day and 4 digit year to be changed (10 valid characters).
* If value is not a valid formatted string, a &quot;Type Mismatch&quot; error results. The previous DATE$ value will be retained.
* The current date (as assigned when the operating system was initialized) can be saved to restore later with the [[DATE$]] function.
*The DATE$ function returns a 10-character string in the form ''mm-dd-yyyy''. ''mm'' is the month (01 to 12), ''dd'' is the day (01 to 31), and ''yyyy'' is the four digit year.
* '''Note: Some systems may not allow the DATE to be reset or require Administrator privileges.''' Try a batch file or [[SHELL]].
* [[Keywords_currently_not_supported_by_QB64#Keywords_Not_Supported_in_Linux_or_MAC_OSX_versions|Keyword Not Supported in Linux or MAC versions]]
''Example:'' Backdating computer to run old software.
{{CodeStart}}
today$ = {{Cl|DATE$}} ' function saves current computer date value
PRINT today$ ' verify actual date
{{Cl|DATE$ (statement)|DATE$}} = &quot;12-25-2000&quot; ' literal statement changes date
PRINT {{Cl|DATE$}} ' verify new date setting
{{Cl|SHELL}} &quot;CMD /C &quot; + programfile$ 'run old program
K$ = {{Cl|INPUT$}}(1) ' press a key
DATE$ = today$ ' statement resets computer to original date later in program
PRINT {{Cl|DATE$}} ' verify present setting
{{CodeEnd}}
{{OutputStart}}
09-01-2009
12-25-2000
09-01-2009
{{OutputEnd}}
''See also:''
[[DATE$]], [[TIME$]], [[TIME$ (statement)]]
{{PageNavigation}}