to_datetime.json 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. {
  2. "comment" : "This is generated by ESQL’s AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.",
  3. "type" : "scalar",
  4. "name" : "to_datetime",
  5. "description" : "Converts an input value to a date value.\nA string will only be successfully converted if it’s respecting the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`.\nTo convert dates in other formats, use `DATE_PARSE`.",
  6. "note" : "Note that when converting from nanosecond resolution to millisecond resolution with this function, the nanosecond date is truncated, not rounded.",
  7. "signatures" : [
  8. {
  9. "params" : [
  10. {
  11. "name" : "field",
  12. "type" : "date",
  13. "optional" : false,
  14. "description" : "Input value. The input can be a single- or multi-valued column or an expression."
  15. }
  16. ],
  17. "variadic" : false,
  18. "returnType" : "date"
  19. },
  20. {
  21. "params" : [
  22. {
  23. "name" : "field",
  24. "type" : "date_nanos",
  25. "optional" : false,
  26. "description" : "Input value. The input can be a single- or multi-valued column or an expression."
  27. }
  28. ],
  29. "variadic" : false,
  30. "returnType" : "date"
  31. },
  32. {
  33. "params" : [
  34. {
  35. "name" : "field",
  36. "type" : "double",
  37. "optional" : false,
  38. "description" : "Input value. The input can be a single- or multi-valued column or an expression."
  39. }
  40. ],
  41. "variadic" : false,
  42. "returnType" : "date"
  43. },
  44. {
  45. "params" : [
  46. {
  47. "name" : "field",
  48. "type" : "integer",
  49. "optional" : false,
  50. "description" : "Input value. The input can be a single- or multi-valued column or an expression."
  51. }
  52. ],
  53. "variadic" : false,
  54. "returnType" : "date"
  55. },
  56. {
  57. "params" : [
  58. {
  59. "name" : "field",
  60. "type" : "keyword",
  61. "optional" : false,
  62. "description" : "Input value. The input can be a single- or multi-valued column or an expression."
  63. }
  64. ],
  65. "variadic" : false,
  66. "returnType" : "date"
  67. },
  68. {
  69. "params" : [
  70. {
  71. "name" : "field",
  72. "type" : "long",
  73. "optional" : false,
  74. "description" : "Input value. The input can be a single- or multi-valued column or an expression."
  75. }
  76. ],
  77. "variadic" : false,
  78. "returnType" : "date"
  79. },
  80. {
  81. "params" : [
  82. {
  83. "name" : "field",
  84. "type" : "text",
  85. "optional" : false,
  86. "description" : "Input value. The input can be a single- or multi-valued column or an expression."
  87. }
  88. ],
  89. "variadic" : false,
  90. "returnType" : "date"
  91. },
  92. {
  93. "params" : [
  94. {
  95. "name" : "field",
  96. "type" : "unsigned_long",
  97. "optional" : false,
  98. "description" : "Input value. The input can be a single- or multi-valued column or an expression."
  99. }
  100. ],
  101. "variadic" : false,
  102. "returnType" : "date"
  103. }
  104. ],
  105. "examples" : [
  106. "ROW string = [\"1953-09-02T00:00:00.000Z\", \"1964-06-02T00:00:00.000Z\", \"1964-06-02 00:00:00\"]\n| EVAL datetime = TO_DATETIME(string)",
  107. "ROW int = [0, 1]\n| EVAL dt = TO_DATETIME(int)"
  108. ],
  109. "preview" : false,
  110. "snapshot_only" : false
  111. }