PDA

Click to See Complete Forum and Search --> : Help me fix this control to show AM/PM time, not 24 hour time


ccs
Apr 12th, 2002, 09:07 PM
I have the c++ source code for a dayview control that displays 24 hour time on the control; 01, 02, 13, 14, (like military hours). I would like to change the display time to show 12 hour AM and PM time.

Can anyone help with finding where the code is that sets up the 24 hour display time, and then how to change this to show 12 hour am, pm time?

The original develper seems to have abandoned the project.

I've attached the c++ source, and a vb sample program.

One more issue in the vb sample app. The scroll down doesn't work. When you click on the down arrow, the calendar display just flickers some, and the times don't move.

Any help is greatly appreciated with either of these issues.

Thanks,

cpradio
Apr 12th, 2002, 09:47 PM
why not just grab the hour if it is over 12 subtrack 12 from the hour number and set the daytime to "PM" else set the daytime for "AM"

-Matt

ccs
Apr 13th, 2002, 10:01 AM
I program with VB, not C.
But I looked around the C source code and couldn't find where the functions or routines are located for setuping up the time and hours.

Do you see where functions are and how it is done? If so, please let me know.

Thanks,

ccs
Apr 14th, 2002, 03:36 PM
I say 12:30 am, and 11:30 pm.
I can succesfully compile the dll by doing a batch build with release mindependency. I'm not familiar with C, so I've had to play around with compiling to get it to work. All the source files should be in the original attached zip file.
I checked the new am pm code you posted, but instead of hours displayed, I get am or pm where the hours should be, but no hours. I attached a small image capture of what it looks like.

Any ideas on what to change in the code to get the hours to display along with am and pm?

Thanks for your help,

CornedBee
Apr 15th, 2002, 08:51 AM
I'd say it just doesn't fit, so change some paramteres in the CreateFont call.