LB Booster
« Converting 24 hour clock to 12 hour »

Welcome Guest. Please Login or Register.
Nov 22nd, 2017, 8:49pm

Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
LB Umbrella forum
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Converting 24 hour clock to 12 hour  (Read 137 times)
Richard Russell

member is offline


Homepage PM

Posts: 1278
xx Converting 24 hour clock to 12 hour
« Thread started on: Aug 4th, 2017, 3:01pm »

Over at the Liberty BASIC Community Forum they're getting their knickers in a twist over converting 24 to 12 hour clock. It's actually straightforward:

    for h24 = 0 to 23
        h12 = ((h24 + 11) mod 12) + 1
        if h24 < 12 then ampm$ = "AM" else ampm$ = "PM"
        print h24, h12, ampm$

User IP Logged

New Member

member is offline



Posts: 28
xx Re: Converting 24 hour clock to 12 hour
« Reply #1 on: Aug 6th, 2017, 9:42pm »

What a coincidence! I just posted a similar topic on the BBC forum. LOL

I tried to run the example on Liberty v4.5 but I cant get it to run on WINDOWS 10.. so I just used LBB.

*unable to allocate virtual address space

Update: I downloaded latest release and Liberty Basic will now function. (version 4.51 )
« Last Edit: Aug 6th, 2017, 10:00pm by michael » User IP Logged

I make program generators and some utilities. Its my hobby
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls