[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

dtpicker control and format function

Posted on 2001-07-22
6
Medium Priority
?
192 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
[X]
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
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
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.

 
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 60 total points
ID: 6308447
Hi,

for the number thing:

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

Zaphod.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

650 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