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

Date in Aspect

Status
Not open for further replies.

wilsonza

Programmer
Mar 16, 2002
4
US
I'm trying to write the script so I don't need a different (other language) to provide the date How do I get a date in Procomm with a mm/dd/yy format?
 
I'm not aware of a "Format Date" function in Aspect. What I would do is get the date/time, then extract each part of the date and then format the date the way I want it. Here's a simple example:

lDate = $LTIME
lTimeInts lDate iYear iMonth iDay iHr iMin iSec
strfmt sDate "%i/%i/%i" iMonth iDay iYear
 
Wilson,

If all you want is the Date in a MM/DD/YY Format, then use the $DATE Function.

string aDate
aDate = $DATE
termwrites aDate
termwrites "`n`r"

Hank
 
Wilson,

Try this. Modified from the Help Pages.

proc main
integer Month, Day ; Integers to contain date and
integer Year, Hour ; time converted from long
integer Min, Sec ; Min and Sec.
;string MonStr ; String to contain month.

; Convert long time value into it's counter parts, year,
; month, day, hour, min, and sec.

ltimeints $LTIME Year Month Day Hour Min Sec

;monthstr Month MonStr ; Get the month in string format.

usermsg "IT's: %02d %d %d At: %d:%d" Month Day Year Hour Min

endproc

You May want to change the user message so that the Day Variable is printed before the Month Variable.

Hank
 
try this one it gives the date of today.....i hope it's helpfull for you

#define DEBUG ; #Define this macro if debugging
proc main
string today

today = $DATE
#ifdef DEBUG ; If debugging, display message
usermsg "`"The returned date was %s`"" today
#endif
endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top