time format

For questions about using Classic.

Post » Tue Jan 24, 2012 2:16 am

hello I've made a clock in construct classic. my problem is how can I set the time to 12 hour format instead of military 24 hour time format?

for example if its 7:45 my clock shows 19:45 how can I make it 12 hour format? I'm using system to do the date and time.

Thank you
B
4
S
1
G
1
Posts: 61
Reputation: 772

Post » Tue Jan 24, 2012 1:34 pm

use modulo:

hour = hour % 12
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Tue Jan 24, 2012 9:59 pm

ok thank you. Whats Modulo
B
4
S
1
G
1
Posts: 61
Reputation: 772

Post » Tue Jan 24, 2012 10:23 pm

from WikiPedia.

Modulo is the remainder after division.

e.g.

9 % 3 = 0

4 % 3 = 1

In Tulamide's example, if hour = 14

then hour = 14 % 12 = 2.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
126
S
29
G
73
Posts: 5,089
Reputation: 51,998

Post » Wed Jan 25, 2012 5:20 am

Hi thank you for your reply.
can you send me an example cap. I really don't understand it...

Thank you
B
4
S
1
G
1
Posts: 61
Reputation: 772


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests