Skip to content

Instantly share code, notes, and snippets.

@willmorgan
Created February 19, 2018 15:13
Show Gist options
  • Save willmorgan/7e3d41a5888523e215a4fb26c926ebab to your computer and use it in GitHub Desktop.
Save willmorgan/7e3d41a5888523e215a4fb26c926ebab to your computer and use it in GitHub Desktop.
Azure Function Runtime ISO8601 datetime mangling
{
"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"
}
]
}
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