Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

dtpicker control and format function

Posted on 2001-07-22
6
184 Views
Last Modified: 2012-05-04
i have 2 questions
1- in the DTPicker control i set format to custom, and custom format to hh:mm:ss but when run the program all things is ok except one thing i want the hours to be from 00 to 23 not from 00 to 12 how can i do that?

2- i want to use the format function in order two represent any number in 4 characters only and leave blank (not 0) in the case of the number is less than 4 characters
e.g.

"1234" => "1234"
"12  " => "  45"  (not "0045")
0
Comment
Question by:aft
6 Comments
 
LVL 1

Expert Comment

by:Joshyy
ID: 6306053
instead of hh:mm:ss make the format HH:mm:ss
0
 
LVL 1

Expert Comment

by:Joshyy
ID: 6306057
what do u mean in your second question?
0
 

Author Comment

by:aft
ID: 6306073
i want to display any number in 4 characters if the number is less than 4 charcters add a space or more  before it
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Expert Comment

by:andysalih
ID: 6306351

Private Sub Form_Load()
    Label1.Caption = Format(Now, "Long Time") & vbCrLf & Format(Now, "Medium Time") & vbCrLf & Format(Now, "Short Time") & vbCrLf & Format(Now, "General Date") & vbCrLf & Format(Now, "Long Date") & vbCrLf & Format(Now, "Medium Date") & vbCrLf & Format(Now, "Short Date")
End Sub


shows different samples of time format

is that what you require

regards
Andy
0
 
LVL 3

Expert Comment

by:andysalih
ID: 6306359
0
 
LVL 7

Accepted Solution

by:
Z_Beeblebrox earned 20 total points
ID: 6308447
Hi,

for the number thing:

Space(4 - Len(CStr(intNumber))) & CStr(intNumber)

Zaphod.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question