mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
These functions allow for direct creation of date/time values. Previously this was only possible by going through the to_datetime/to_date/to_time functions, which are string based and accordingly frustrating/inefficient to use when you have numeric date/time component values.
17 lines
760 B
Plaintext
17 lines
760 B
Plaintext
{
|
|
"name": "make_datetime",
|
|
"type": "function",
|
|
"description": "Creates a datetime value from year, month, day, hour, minute and second numbers.",
|
|
"arguments": [
|
|
{"arg":"year","description":"Year number. Years 1 to 99 are interpreted as is. Year 0 is invalid."},
|
|
{"arg":"month","description":"Month number, where 1=January"},
|
|
{"arg":"day", "description":"Day number, beginning with 1 for the first day in the month"},
|
|
{"arg":"hour", "description":"Hour number"},
|
|
{"arg":"minute", "description":"Minutes"},
|
|
{"arg":"second", "description":"Seconds (fractional values include milliseconds)"}
|
|
],
|
|
"examples": [
|
|
{ "expression":"make_datetime(2020,5,4,13,45,30.5)", "returns":"datetime value 2020-05-04 13:45:30.500"}
|
|
]
|
|
}
|