4Test Code: TimeStamp for Current time
[+] public void GetCurrentDateTime(out String sDate optional, out String sTime optional,String sDateFormat null optional,String sTimeFormat null optional)
[ ] // Purpose: Current date and time are taken from the system.
[ ] DateTime dtmCurrent
[ ]
[+] if (IsNull(sDateFormat))
[ ] sDateFormat = "mm/dd/yyyy"
[+] if (IsNull (sTimeFormat))
[ ] sTimeFormat = "hh:nn:ss AM/PM"
[ ] dtmCurrent = GetDateTime ( )
[ ] sTime=FormatDateTime (dtmCurrent, sTimeFormat)
[ ] sDate=FormatDateTime (dtmCurrent, sDateFormat)
[+] String GetTimeStamp()
[ ] //Purpose: To get current time stamp in the given format
[ ] String sDate, sTime
[ ] String sTcFile
[ ] STRING sPrefix
[ ]
[ ] GetCurrentDateTime (sDate, sTime,"yyyymmdd","hhnnss" )
[ ] sPrefix = "{sDate}{sTime}"
[ ] return sPrefix
No comments:
Post a Comment