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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ltimeints problem w Hour

Status
Not open for further replies.

lakehouse

Technical User
May 17, 2004
45
US
Strange problem. I am using the ltimeints function and the Hour result always returns a '1'. It does not matter what time of the day it actually is, I always get a 1 for the hour.

Here's how I am using it:

integer Year, Month, Day, Hour, Min, Sec
string cNow
ltimeints $LTIME Year Month Day Hour Min Sec
strfmt cNow "%s %s %s %s %s %s" Year Month Day Hour Min Sec
usermsg cNow

At 5:35 PM CT on 10/17/05 I get the following User Message:
2005 10 17 1 35 43

If I use the ltimestring function the same Date/Time will report correctly as: 10/17/2005 5:35:43PM

Running Procomm 4.8 on Win2000 Professional o/s.
(I need this per my previous posting about Hourly Polling of PBX Traffic). Any suggestions?
 
When I ran this on my 98 machine, the results were (null), which is to be expected since the variables are integers but you are using a %s (string) format variable. What happens if you change all of the occurrences of %s to %d?

 
knob,

I did change the format variable to %d as I initially noticed the <null> results showing up on the text output I send to the file when %s is used. I erroneously typed the %s on my posting.

I still have the same problem with the Hour output I described.
 
Can't explain it, but when I use a different variable name for "Hour" such as "Hr" the results are perfect.

I searched the entire Aspect script for instances of 'Hour' to see if some other operation is manipulating the data. - nothing. I do use the ltimeinst function 3 times in different procs within the same script if that could be a reason...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top