LB Booster
« Converting 24 hour clock to 12 hour »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:56am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
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
BBC BASIC Home Page
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 239 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
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:

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

Richard.
User IP Logged

michael
New Member
Image


member is offline

Avatar




PM


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 »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls