This is the ThingsDB documentation for version v0, click here for the latest version!
Return a new datetime (or timeval) object with altered properties. The new properties must be given by a thing.
This function does not generate an event.
datetime.replace(values)
| Argument | Type | Description |
|---|---|---|
values |
thing (required) |
Only the properties year, month, day, hour, minute, second will be used, all other properties are simply ignored. |
Returns a new datetime (or timeval) object.
This code uses
replace()as an example:
datetime('2020-12-10T16:08:24Z').replace({
minute: 0,
second: 0,
});
Return value in JSON format
"2020-12-10T16:00:00Z"