blob: 84657cc1e6faa08043ccf5a966714fc397426994 [file] [log] [blame]
import SwiftyJSON
func main(args: [String:Any]) -> [String:Any] {
let invokeResult = Whisk.invoke(actionNamed: "/whisk.system/util/date", withParameters: [:])
let dateActivation = JSON(invokeResult)
// the date we are looking for is the result inside the date activation
if let dateString = dateActivation["response"]["result"]["date"].string {
print("It is now \(dateString)")
} else {
print("Could not parse date of of the response.")
}
// return the entire invokeResult
return invokeResult
}