Checking AM or PM 
Author Message
 Checking AM or PM

Hi all

I want to check the computer time for am or pm (ver 2003)

if clock() < 12   (this would be before noon)

if clock() > 12  (this would be afternoon)

is this right or does one have to compute the seconds

Don Harvey



Sun, 18 Feb 2001 03:00:00 GMT  
 Checking AM or PM
Don,
if clock() > 4320000 then its PM else its AM.
This is because Clarion treats the time as 100ths of a second since
midnight.

HTH



Sun, 18 Feb 2001 03:00:00 GMT  
 Checking AM or PM
Yep,

That works perfect.  Many thanks.

Don

Quote:

>Don,
>if clock() > 4320000 then its PM else its AM.
>This is because Clarion treats the time as 100ths of a second since
>midnight.

>HTH



Mon, 19 Feb 2001 03:00:00 GMT  
 Checking AM or PM

Quote:
>if clock() > 4320000 then its PM else its AM.
>This is because Clarion treats the time as 100ths of a second since
>midnight.

Make that 4320000 + 1

0 is no time
1 is midnight


4320001 would display as 12:00

(A 1/100 second makes the display appear to be out by 1 minute!)

Regards
Malcolm Collett
------------------------------
mcollett AT iafrica DOT com
==============================



Mon, 19 Feb 2001 03:00:00 GMT  
 Checking AM or PM
for clarity and easy readability od my code, I use:


Quote:

>>if clock() > 4320000 then its PM else its AM.
>>This is because Clarion treats the time as 100ths of a second since
>>midnight.

>Make that 4320000 + 1

>0 is no time
>1 is midnight


>4320001 would display as 12:00

>(A 1/100 second makes the display appear to be out by 1 minute!)

>Regards
>Malcolm Collett
>------------------------------
>mcollett AT iafrica DOT com
>==============================



Tue, 20 Feb 2001 03:00:00 GMT  
 Checking AM or PM

Quote:

> >if clock() > 4320000 then its PM else its AM.
> >This is because Clarion treats the time as 100ths of a second since
> >midnight.

> Make that 4320000 + 1

> 0 is no time
> 1 is midnight


> 4320001 would display as 12:00

> (A 1/100 second makes the display appear to be out by 1 minute!

Exactly right on the time. Thats why I am checking to see if its GREATER
than 4320000. As such, there is no need to add anything to the clock.


Tue, 20 Feb 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Converting AM/PM time to military and vise versa

2. I am stuk CHECK my Code - access.txt (0/1)

3. PM to VM86 to PM ?

4. **** SERIAL COMMUNICATION CLASSES FOR OS/2 PM (SMALLTALK V/PM)

5. I am not deaf, but am I mute?

6. File check in/check out

7. changing the size of the check button on a check button menu entry

8. How do I programatically switch the time on a chart between 24 hour and AM/PM?

9. Has anyone example AM,FM,PM modulation&demodulation?

10. OT - Humor (was: Is 12:00 Noon considered AM or PM?

11. AM/PM time display in date() different from the common use ?

12. Memory Management - Smalltalk/V PM

 

 
Powered by phpBB® Forum Software