Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DATE$ function
#2
(10-04-2023, 05:31 AM)eoredson Wrote: I would like to be able to set the system date.

It's not allowed on Linux, nor set the `TIME$` from QB64. It would require temporary superuser permission.

I guess the command versions were a trick that worked very well on 16-bit computers running GW-BASIC or BASICA. But it became dangerous to allow the user to change the date and time from a program. Even though Windows10 and earlier never resisted the user setting the time completely wrong. Probably Windows11 has become line Linux. Some operating systems don't handle time zone correctly. They don't allow NTP sync which is otherwise a solution for improperly setting the time according to time zone related to UTC. On one distro I have to run a separate program for NTP sync because, for some reason, the GUI system settings for that operating system keeps the whole dialog greyed out. I cannot even manually set the date and time.

I noticed something else, LOL you're trying to use `INPUT` to obtain a date! You will have to check the input rigidly. There are a wide variety of date formats. What if the user wants to type in a day of the week, but it's wrong for the given date? "Tuesday October 4 2023"? It could be dangerous to accept that. (Today is Wednesday.) If you look at the help for `strftime()` function in C, you would notice there are mind-boggling combinations of displaying items from the date, time or time zone.
Reply


Messages In This Thread
DATE$ function - by eoredson - 10-04-2023, 05:31 AM
RE: DATE$ function - by mnrvovrfc - 10-04-2023, 07:11 AM
RE: DATE$ function - by SpriggsySpriggs - 10-04-2023, 11:19 AM
RE: DATE$ function - by SMcNeill - 10-04-2023, 11:27 AM
RE: DATE$ function - by TempodiBasic - 10-04-2023, 05:04 PM
RE: DATE$ function - by bplus - 10-04-2023, 05:34 PM
RE: DATE$ function - by RhoSigma - 10-04-2023, 06:23 PM
RE: DATE$ function - by Kernelpanic - 10-04-2023, 07:23 PM
RE: DATE$ function - by eoredson - 10-04-2023, 10:24 PM
RE: DATE$ function - by SMcNeill - 10-04-2023, 10:36 PM
RE: DATE$ function - by TerryRitchie - 10-04-2023, 10:51 PM
RE: DATE$ function - by eoredson - 10-04-2023, 10:52 PM
RE: DATE$ function - by eoredson - 10-04-2023, 11:10 PM
RE: DATE$ function - by eoredson - 10-05-2023, 01:49 AM
RE: DATE$ function - by SpriggsySpriggs - 10-05-2023, 11:11 AM
RE: DATE$ function - by eoredson - 10-06-2023, 12:57 AM
RE: DATE$ function - by SpriggsySpriggs - 10-06-2023, 02:10 AM
RE: DATE$ function - by eoredson - 10-06-2023, 02:22 AM
RE: DATE$ function - by SpriggsySpriggs - 10-06-2023, 02:58 AM
RE: DATE$ function - by eoredson - 10-06-2023, 04:33 AM
RE: DATE$ function - by eoredson - 10-06-2023, 03:43 AM
RE: DATE$ function - by SpriggsySpriggs - 10-06-2023, 12:26 PM
RE: DATE$ function - by eoredson - 10-07-2023, 05:01 AM
RE: DATE$ function - by SpriggsySpriggs - 10-07-2023, 01:49 PM
RE: DATE$ function - by mnrvovrfc - 10-07-2023, 05:03 AM
RE: DATE$ function - by eoredson - 10-08-2023, 10:21 PM
RE: DATE$ function - by eoredson - 10-11-2023, 04:25 AM
RE: DATE$ function - by SpriggsySpriggs - 10-12-2023, 03:14 AM
RE: DATE$ function - by eoredson - 10-12-2023, 11:25 PM
RE: DATE$ function - by SMcNeill - 10-12-2023, 11:37 PM
RE: DATE$ function - by eoredson - 10-13-2023, 12:46 AM
RE: DATE$ function - by eoredson - 10-19-2023, 01:35 AM
RE: DATE$ function - by eoredson - 10-21-2023, 03:15 AM
RE: DATE$ function - by SMcNeill - 10-21-2023, 04:17 AM
RE: DATE$ function - by eoredson - 10-21-2023, 05:52 AM
RE: DATE$ function - by SpriggsySpriggs - 10-21-2023, 04:07 AM
RE: DATE$ function - by SpriggsySpriggs - 10-21-2023, 06:50 AM
RE: DATE$ function - by eoredson - 10-23-2023, 01:29 AM
RE: DATE$ function - by SMcNeill - 10-23-2023, 01:40 AM
RE: DATE$ function - by SpriggsySpriggs - 10-23-2023, 11:55 AM
RE: DATE$ function - by eoredson - 10-24-2023, 01:49 AM
RE: DATE$ function - by SMcNeill - 10-24-2023, 02:32 AM
RE: DATE$ function - by SMcNeill - 10-24-2023, 02:36 AM
RE: DATE$ function - by eoredson - 10-25-2023, 02:40 AM
RE: DATE$ function - by mnrvovrfc - 10-25-2023, 03:43 AM
RE: DATE$ function - by eoredson - 10-25-2023, 04:00 AM
RE: DATE$ function - by SpriggsySpriggs - 10-25-2023, 12:13 PM
RE: DATE$ function - by eoredson - 10-25-2023, 11:53 PM
RE: DATE$ function - by Kernelpanic - 10-26-2023, 12:27 AM
RE: DATE$ function - by PhilOfPerth - 10-26-2023, 02:49 AM
RE: DATE$ function - by eoredson - 10-26-2023, 02:30 AM
RE: DATE$ function - by eoredson - 10-27-2023, 11:04 PM
RE: DATE$ function - by SMcNeill - 10-27-2023, 11:23 PM
RE: DATE$ function - by eoredson - 10-27-2023, 11:29 PM
RE: DATE$ function - by SMcNeill - 10-28-2023, 12:09 AM
RE: DATE$ function - by eoredson - 10-28-2023, 12:24 AM



Users browsing this thread: 10 Guest(s)