Service Time

from time import Time

Port NameLocationProtocolInterfaces
iplocalTimeInterface

List of Available Interfaces

TimeInterface

Operation NameInput TypeOutput TypeFaultsDescription
cancelTimeoutlongbool-
It Cancels a timeout from a long-value created from #scheduleTimeout
getCurrentDateTimeCurrentDateTimeRequestTypestring-
It returns the current date time as a string
getCurrentDateValuesvoidDateValuesType-
Returns the current date split in three fields: day, month and year
getCurrentTimeMillisvoidlong-
Warning: this is temporary and subject to future change as soon as long is supported by Jolie.
getDateDiffDiffDateRequestTypeint-
getDateTimeGetDateTimeRequestGetDateTimeResponse-
It returns a date time in a string format starting from a timestamp
getDateTimeValuesGetTimestampFromStringRequestDateTimeType
InvalidDateundefined
getDateValuesDateValuesRequestTypeDateValuesType
InvalidDateundefined

Converts an input string into a date expressed by means of
three elements: day, month and year. The request may specify the
date parsing format. See #DateValuesRequestType for details.
getTimeDiffGetTimeDiffRequestint-
getTimeFromMilliSecondsintTimeValuesType-
getTimeValuesstringTimeValuesType-
getTimestampFromStringGetTimestampFromStringRequestlong
InvalidTimestampundefined
scheduleTimeoutScheduleTimeOutRequestlong
InvalidTimeUnitundefined

Schedules a timeout, which can be cancelled using #cancelTimeout from the returned string. Default .timeunit value is MILLISECONDS, .operation default is "timeout".
setNextTimeoutSetNextTimeOutRequest--
it sets a timeout whose duration is in milliseconds and it is represented by the root value of the message
When the alarm is triggered a message whose content is defined in .message is sent to operation defined in .operation
( default: timeout )
setNextTimeoutByDateTimeundefined--
setNextTimeoutByTimeundefined--
sleepintvoid-
It waits for a period specified in the request (in milliseconds)
stopNextTimeoutvoid--It stops the current timeout previously set with a setNextTimeout

Types

CurrentDateTimeRequestType:
Type Declaration
void {
  format[0,1]: string // 
}
DateTimeType:
Type Declaration
void {
  month[1,1]: int // 
  hour[1,1]: int // 
  year[1,1]: int // 
  day[1,1]: int // 
  minute[1,1]: int // 
  second[1,1]: int // 
}
DateValuesRequestType:
Type Declaration
string {
  format[0,1]: string // 
}
DateValuesType: WARNING: work in progress, the API is unstable.
Type Declaration
void {
  month[1,1]: int // 
  year[1,1]: int // 
  day[1,1]: int // 
}
DiffDateRequestType:
Type Declaration
void {
  format[0,1]: string // 
  date2[1,1]: string // 
  date1[1,1]: string // 
}
GetDateTimeRequest:
Type Declaration
long {
  format[0,1]: string // 
}
GetDateTimeResponse:
Type Declaration
string {
  month[1,1]: int // 
  hour[1,1]: int // 
  year[1,1]: int // 
  day[1,1]: int // 
  minute[1,1]: int // 
  second[1,1]: int // 
}
GetTimeDiffRequest:
Type Declaration
void {
  time1[1,1]: string // 
  time2[1,1]: string // 
}
GetTimestampFromStringRequest:
Type Declaration
string {
  format[0,1]: string // 
  language[0,1]: string // 
}
ScheduleTimeOutRequest:
Type Declaration
int {
  message[0,1]: undefined // 
  operation[0,1]: string // 
  timeunit[0,1]: string // 
}
SetNextTimeOutRequest:
Type Declaration
int {
  message[0,1]: undefined // 
  operation[0,1]: string // 
}
TimeValuesType:
Type Declaration
void {
  hour[1,1]: int // 
  minute[1,1]: int // 
  second[1,1]: int // 
}