Solved

dtpicker control and format function

Posted on 2001-07-22
6
180 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now