RSS

Dates and Times

04 Jan

We can get the current date and time in the format <day> – <month> – <year>, <h> <minutes>: <seconds>

-Object input
!DateObj = OBJECT DATETIME()

Ask-day
!Day = !DateObj.Date()
Ask-month
!Month = !DateObj.month()
Ask-year
!Year = !DateObj.Year()

Ask-hour
!Hour = !DateObj.Hour()
Ask-minute
!Minute = !DateObj.Minute()
-Ask for seconds
!Second = !DateObj.Second()

-Perform “glue” of the data

!Result = !Day & ‘-‘ & !Month & ‘-‘ & !Year & ‘,’ & !Hour & ‘:’ & !Minute & ‘:’ & !Second

The result will be something like:
<STRING> ’12-3-2011, 13:38:6 ‘

 
Leave a comment

Posted by on January 4, 2013 in PDMS Training and Knowledge

 

Tags: , , , ,

Leave a comment