Contents 

Overview
Fundamentals
Variable declaration
Variable assignment
Adding variables
Setting variables
Include function
Evaluate function
Constants
Arrays
If...then...else Statement
For Statement
Foreach Statement
While Statement
Function definition
Operators
Comments
Functions
String processing
Overview
Length
Left
Right
Mid
TrimLeft
TrimRight
ToUpper
ToLower
Find
ReverseFind
WildcardCompare
Tokenize
RegularExpressionMatch
RegularExpressionParse
Operator [ ]
Delete
Remove
Replace
File IO routines
Overview
ReadData
ReadDataToString
WriteData
ReadString
WriteString
AppendString
EOF
CloseFile
CreateDir
RemoveDir
ChangeDir
GetCurrentDir
IsFileExist
FileSize
CopyFile
MoveFile
RemoveFile
Seek
SeekToBegin
SeekToEnd
ListFiles
CountFilesInFolder
Time routines
Overview
Sleep
Millisleep
GetTime
GetTimeString
FormatTime
ConvertToUnixTime
GetTickCount
SNMP management
Overview
SnmpGet
SnmpGetNext
SnmpSet
GetPduErrorStatus
GetPduErrorString
GetPduErrorIndex
GetVarCount
GetVarAt
CreatePdu
AppendVar
GetVarOID
GetVarResolvedName
GetVarValue
GetVarResolvedValue
GetVarResolvedDescription
GetVarSyntax
CreateVar
GetPduIp
GetPduEnterprise
GetPduTrapCode
GetPduTrapName
GetPduResolvedTrapName
GetPduResolvedTrapDescription
GetPduCommunity
SendTrap
ForwardTrap
SNMP MIB functions
Overview
LoadMIB
ResolveOID
GetOidByName
ResolveTrap
UnloadMIB
XML processing
Overview
ReadXml
WriteXml
GetXmlTag
CreateXml
InsertAttr
IsXmlValid
SelectXmlNodes
GetAttrString
GetAttrInt
GetAttrDouble
GetXmlBody
SetXmlBody
AddChild
GetChildrenCount
GetChildAt
FTP functions
Overview
FtpOpen
FtpClose
FtpGetCurrentDir
FtpSetCurrentDir
FtpCreateDir
FtpRemoveDir
FtpGet
FtpPut
FtpRemoveFile
FtpRenameFile
FtpListFiles
FtpCountFilesInFolder
TFTP functions
Overview
TFTPGet
TFTPPut
TCP functions
Overview
HttpPing
HttpGet
OpenTCPConnection
OpenUDPSocket
SendTCPData
SendUDPData
IsDataAvailable
ReadTCPData
ReadUDPData
CloseSocket
GetHostByAddress
GetAddressByName
TestSMTPConnection
GetHostName
GetSocketName
TestPOP3Connection
POP3GetStats
POP3 Mail Client Example
Working with serial ports
Overview
OpenSerialPort
CloseSerialPort
IsSerialDataAvailable
ReadSerialData
WriteSerialData
Handling zip files
Overview
ZipFiles
UnzipFiles
AddFileToZip
RemoveFileFromZip
ListFilesInZip
UnzipFile
Mathematical routines
Overview
abs
acos
asin
atan
CalculateScaleFactor
cos
cosh
exp
IsNAN
log
log10
max
mod
pow
ScaleArray
sin
sinh
sqrt
tan
tanh
Charts
Overview
CreateGauge
CreatePieChart
CreateBarChart
CreateLineChart
CreateXYLineChart
Database Interface
Overview
DBOpen
DBClose
DBExecuteSQL
DBSelect
DBInsertSelect
DBGetSQLStatus
DBGetSQLErrorString
Round Robin Databases
Overview
RrdCreate
RrdUpdate
RrdRemove
RrdFetch
RrdGetCurrentValue
Event Log functions
Overview
EventLogGetNumberOfRecords
EventLogGetOldestRecord
EventLogReadRecord
EventLogWaitForEvent
EventLogWriteRecord
Service Control Manager
Overview
SCMEnumerateServices
SCMGetServiceInfo
SCMStartService
Parameter Files
Overview
GetParameterCount
GetParameterName
GetParameterType
GetParameterValue
GetParameterDisplayName
GetParameterDescription
Process management functions
Overview
FindProcess
GetProcesses
RedirectOpen
RedirectClose
RedirectGetStdOut
RedirectGetStdError
RedirectSendInput
WMI functions
Overview
WMIOpen
WMIClose
WMIQuery
WMIGetErrorStatus
Query functions
Overview
LDAPQuery
REGQuery
CSVQuery
TSVQuery
EventLogQuery
TextLineQuery
TextWordQuery
FSQuery
GetQueryStatus
GetQueryErrorString
Windows Networking
Overview
MapNetworkDrive
DisconnectNetworkDrive
Microsoft Outlook integration
Overview
OpenOutlookSession
CloseOutlookSession
OutlookSendMail
OutlookSendMeetingRequest
OutlookCreateTask
Other routines
Overview
Println
MessageBox
ToString
ToInteger
ToDouble
ToChar
ToByte
GetEnv
GetArraySize
Beep
GetArrayIndex
GetNetDecisionSystemDir
IsArrayElementExist
Ping
SendMail
SendHtmlMail
ExecuteCommand
PlaySound
TextToSpeech
SendSMS
Rand

NetDecision Script Language Reference

Prev Page Next Page

FormatTime

string FormatTime(int unixTime, string format )

Return Value

Returns the date and time as formatted string converted from unix time (number of seconds elapsed since January 1, 1970) according to the provided format specification.

Parameters

format - specifies a format-control string.

unixTime - specifies a unix time value.

Remarks

Call this function to convert the date and time value into formatted string. The format argument consists of one or more codes. The formatting codes are preceded by a percent sign (%). The formatting codes are listed below:

%a  

Abbreviated weekday name

%A  

Full weekday name

%b  

Abbreviated month name

%B  

Full month name

%c  

Date and time representation appropriate for locale

%d  

Day of month as decimal number (01 – 31)

%H  

Hour in 24-hour format (00 – 23)

%I  

Hour in 12-hour format (01 – 12)

%j  

Day of year as decimal number (001 – 366)

%m  

Month as decimal number (01 – 12)

%M  

Minute as decimal number (00 – 59)

%p  

Current locale's A.M./P.M. indicator for 12-hour clock

%S  

Second as decimal number (00 – 59)

%U  

Week of year as decimal number, with Sunday as first day of week (00 – 53)

%w  

Weekday as decimal number (0 – 6; Sunday is 0)

%W  

Week of year as decimal number, with Monday as first day of week (00 – 53)

%x  

Date representation for current locale

%X  

Time representation for current locale

%y  

Year without century, as decimal number (00 – 99)

%Y  

Year with century, as decimal number

%z, %Z  

Time-zone name or abbreviation; no characters if time zone is unknown

%%  

Percent sign

Example

The following example demonstrates the use of FormatTime.

       Println("The time is ", FormatTime(GetTime(), "%H:%M:%S"))

 Output of the example script:

The time is 12:00:35

   
Converted from CHM to HTML with chm2web Pro 2.76 (unicode)