Created
February 19, 2018 15:13
-
-
Save willmorgan/7e3d41a5888523e215a4fb26c926ebab to your computer and use it in GitHub Desktop.
Azure Function Runtime ISO8601 datetime mangling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"disabled": false, | |
"tracing": { | |
"consoleLevel": "verbose" | |
}, | |
"bindings": [ | |
{ | |
"authLevel": "anonymous", | |
"type": "httpTrigger", | |
"direction": "in", | |
"route": "test-ms", | |
"methods": ["GET", "OPTIONS"], | |
"name": "req" | |
}, | |
{ | |
"type": "http", | |
"direction": "out", | |
"name": "res" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(context, req) { | |
// Set up a datetime at the "top of the second": | |
context.res = { | |
'test_time': '2026-04-20T00:00:00.000Z', | |
}; | |
// Observe that no stringification functionality modifies the underlying datetime string: | |
console.log(JSON.stringify(context.res)); | |
// Runtime outputs test_time with "2026-04-20T00:00:00Z", missing the milliseconds. | |
context.done(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment