Subject |
Re: SET HOURS |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Sat, 22 Jul 2023 19:17:42 +0200 |
Newsgroups |
dbase.getting-started |
On 2023/07/22 14:13, Tom wrote:
> Good morning all,
>
> OLH says:
>
> The following statements convert a DateTime value to a string using
> DTTOC (DateTime to Character) and extracts the date and time strings.
> *
> The following examples assume SET HOURS is set to 12, thereby displaying
> the AM/PM indicator. *** <<< Note <<< ***
> *
> d=DATETIME() // Yields 08/17/00 04:25:45 PM
> d1=DTTOC(d) //Yields 08/17/00 04:25:45 PM as a Character string
> d2=left(d1,8) //Yields 08/17/00 as a Character string
> d3=right(d1,11) //Yields 04:25:45 PM as a Character string
>
> My question is WHERE is the current SET HOURS value stored on my
> computer and how do I find out what it is and, more importantly, where
> is it stored on your computer and how do I find out what it is?
>
> I do not see this information in my Ini file or any place to set this in
> the "properties" form from the main menu.
The setting isn't stored in the ini file. I don't know, so I'm
guessing, but I have a feeling it is determined by the Region setting in
Windows.
The setting can be changed by SET HOURS TO 12|24 but this only remains
valid until dBASE is closed. Unlike other SETable values, which get
saved in the ini file, the next time dBASE runs it will be back to the
original value.
As Ken has pointed out, ? set('hours') will give you the value for your
computer.
To determine the setting for a computer from within your program save
the following to is12or24.prg
function is12or24
return iif('m'$lower(dttoc(datetime())),12,24)
If is12or24.prg is in the same folder as your program or if you include
SET PROCEDURE TO IS12OR24.PRG in your code
nH = is12or24()
? nH
Mervyn.
|
|