Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

Showing time in date time picker

The selections for the ms date time picker dont seem to give an option to show a date like 03/23/05 12:00 PM. I am sure that I can format the thing so that I can show the time and make it possible for the user to edit the date and the time...does someone know how to set this property?
0
MikeORTEC
Asked:
MikeORTEC
  • 6
  • 5
1 Solution
 
gecko_au2003Commented:
Are you doing this in visual basic 6.0 ? If not what language ?
0
 
MikeORTECAuthor Commented:
I am doing this in VB6...sorry
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
MikeORTECAuthor Commented:
I used the PAQ to format the dtp in the following way:

DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "mm/dd/yyyy hh:mm tt"

The date and time now load as I wanted them to, eg 03/23/2005 12:00 PM in the dtp.

But, changing the seconds in the time on the form, changes the month and vice versa...these seem to be somehow connected...if I scroll or change the seconds to 00, the month changes to 00 also....how do I format so that the changes are not tied to each other?
0
 
gecko_au2003Commented:
let me try something out and I will get back to you :)
0
 
gecko_au2003Commented:
Have you got 2 DT Pickers ? one for time and one for date ?
0
 
MikeORTECAuthor Commented:
There are two DT pickers, but I need Date and time for each.  I guess that I could split them, but that would complicate the code.  I am sure that I have seen a DTP with both Date and Time included.  and I have managed to get both in there, but the erroneous linking of time with month needs to be solved.

Thansk.

Miike
0
 
MikeORTECAuthor Commented:
What I would like to be able to do in the first one is get a date from the database in the following format

mm/dd/yyy hh:mm:ss tt

The second one should be set to "today" Noon

like

03/25/2005 12:00:00 PM

it always loads as AM and the minutes and month scroll together for some reason.

Thanks for the assistance!
0
 
gecko_au2003Commented:
Even though splitting would complicate the code it would probably get rid of the time / date clash. So try and do them in seperate ones and you could put 2 of them in a frame and put the other 2 in a frame :) Make it look neater and give them the option of first selecting the data and then the time and you could do some error checking to make sure that they have data in them before they can go to the next 2 :)
0
 
MikeORTECAuthor Commented:
Dear Gecko,

Thanks, I appreciate you taking the time to look at this, but I figured it out.  the problem was that my custom format was mm/dd/yyy hh:mm:ss tt, but should have been capitalized for the month formatting, so it should have been like

MM/dd/yyy hh:mm:ss tt             'note the capitalized MM

This appears to allow me to have it all encapsulated in one control.  Last thing to do is find the property to set a dtp control date to todays date at run time....like the excel property =today() or =now() for individual cells.

I cannot seem to find this property of the control itself...i guess there would be a way to get it from windows and pass it to the control,but I dont know how...

Any help?
0
 
gecko_au2003Commented:
When I had DTPicker1 it had Hour, minute, second and date or something like that so maybe you need to concatenate them ie

DTPicker1.Hour & ":" & DTPicker1.Minute & ":" & DTPicker1.Second

and then something like that for the date ?
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now