Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tips and Tricks request
Message
De
27/07/2001 06:41:46
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
 
À
26/07/2001 23:52:22
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00536201
Message ID:
00536260
Vues:
8
>I want my Text2 text box will get the time format result according to the Text1.Text, for example:
>If 12 entered on Text1, the Text2 will displayed 00:00:12,
>If 22" entered on Text1, the Text2 also displayed 00:00:22
>If 1:12" entered on Text1, the Text2 will displayed 01:12
>
>I have tried the following codes, but does not work:
>Text2.Text = Format(Text1.Text,"Hh:Nn:Ss")
>
>Any body can give me Tips and Tricks for the above problem?.. any idea or suggestion is highly appreciated and thank you in advance..
>
>Best Regards
>Winan


Hi,

Use the Timeserial function to convert the values in Text1 to a time, then format will work. You will need to parse out the hours, minutes and seconds from text1, and convert them to numbers.

e.g.
debug.print Timeserial(23, 10, 34)
23:10:34

debug.print format( Timeserial(23, 10, 34), "hh:mm:ss")
23:10:34 - This will be a string.
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform