Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Convert Time into Number

Status
Not open for further replies.

joethehoe

Technical User
Jan 2, 2002
27
US
Does anybody know how to convert:

TimeValue ({mo_agent_unit.tdTime}) to a number??

I seen a number of differnt ways to convert numbers to time but not back to a number.

something like 5:00:00am and 5:30:00am to 05 and 05.5

Help, Help!!


 
How about:


numberVar intHours := Hour({VP_USERACCOUNT.PWDUPDATEDTM});
numberVar intMinutes := Minute({VP_USERACCOUNT.PWDUPDATEDTM});
numberVar intSeconds := Second({VP_USERACCOUNT.PWDUPDATEDTM});

intHours + (intMinutes / 60) + (intSeconds / 3600)



Peter.
 
What kind of number, seconds?

Hour({VP_USERACCOUNT.PWDUPDATEDTM})*3600+
minutes({VP_USERACCOUNT.PWDUPDATEDTM})*60
+Second({VP_USERACCOUNT.PWDUPDATEDTM})

Sorry, I don't have Crystal in front of me to test syntax, but this is the theory.

-k
 
you can change time into any kind of number you want....you will have to be more specfic as to what kind you want.

SV showed you how to do it for seconds, Pandpp showed you converted to hours...

Other possiblities are minutes, seconds from the start of the year .... and many more...you have to be specific in your wish

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top