Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Time
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: Time
Divers
Thread ID:
00575377
Message ID:
00575928
Vues:
30
Hi Edgar,

That's true - it also has the advantage (or disadvantage depending on your poit of view) of not being dependent on SET HOURS or SET SYSFORMATS. You could also do your calcs like:
TRANSFORM(INT(lnTime/3600) - IIF(INT(lnTime/3600) >= 12, 12, 0), '@L 99') + ':' + TRANSFORM(INT((lnTime - 3600*INT(lnTime/3600)))/60) + ' ' + IIF(INT(lnTime/3600) >= 12, 'PM', 'AM')
We could go on like this all day ... <g>

Cheers,

Andrew

>>>>>If I have a value of 72600, which represents the number of seconds elapsed since midnight, which also happens to be 08:10 pm, how do I convert that into a string that says simply 08:10 pm? Getting the hours is easy, it's the minutes I'm having a problem with. I think I'm going brain dead.
>>>>
>>>>See Message #482883.
>>>
>>>It's close. It should give me some ideas of how to get to what I want. Thanks.
>>
>>James,
>>
>>Try:
>>
>>TTOC(DATETIME(1900, 1, 1, 0, 0, 0) + 72600, 2)
>>
>>
>>Cheers,
>>
>>Andrew
>
>
>and the old fashioned way :~)
>
>
>? AllTrim(STR(IIF(INT(Val(sys(2))/3600)> 12,INT(Val(sys(2))/3600)-12,INT(Val(sys(2))/3600))))+":"+ALLTRIM(STR(INT(60*(Val(sys(2))/3600 % 1))/10))+AllTrim(STR(INT((Val(sys(2))/3600) % 6)/100)+IIF(INT(Val(sys(2))/3600)> 12," pm"," am"))
>


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform