Saving time in MySQLWorkbench

I want to add the current time in a database, as soon as I press a button on the dashboard, but I do not know how to get the value of the current time or how to add in MySqlWorkBench

Do you have access to the schema design/DB model?

if so:

  • Ensure the column type is DATETIME
  • Set this column with a default value of CURRENT_TIMESTAMP

You then don't need to worry about providing it in an insert statement
as the date/time will be inserted automatically

The value being added is null
DBTIMEE

If you have set the default to CURRENT_TIMESTAMP - omit it completely in your insert statement (as if the column doesnt exists)

sending null is sending null :crazy_face:

for a default to be used - it must not be included in your insert
INSERT INTO table(Name,Age) VALUES('Bob',16) <- Don't include the column for datetime

1 Like

I don't know how to leave current timestamp

My flow:

[{"id":"6d0f18521b8cb618","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"5f19424690f6a3ea","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"cb956fffc8798827","type":"tab","label":"Flow 3","disabled":true,"info":"","env":[]},{"id":"ef91409da04e49ee","type":"tab","label":"PRÉ-SIMULADO","disabled":true,"info":"","env":[]},{"id":"56c8cfd2451f355c","type":"tab","label":"Flow 4","disabled":false,"info":"","env":[]},{"id":"41e7b6bbcfa384fd","type":"group","z":"cb956fffc8798827","name":"Notifications","style":{"label":false},"nodes":["656b1925bed741ce","1b91db2672fc7e4a","965b5b00903ef038","e63bdfbc27400376","e4a9d6af0566da27","7bec24dbb42dfb9b","95f95493941a5d52","92539e1fdf7b0df6","4fd00c9c1ded1b61","9766f6b16db70fb6","21c11c7c6f8019f2","07085de1d6e7d00d","521da51fa847192a","515fd53333e238d9","b14c1c4d9b66fd73"],"x":174,"y":199,"w":892,"h":622},{"id":"f017fc194be7f2c1","type":"ui_tab","name":"Controle de lâmpada","icon":"button","disabled":false,"hidden":true},{"id":"0536b5c4c339fad4","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey","palette":"light"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"97db1e21f913b497","type":"ui_group","name":"Acionamento","tab":"f017fc194be7f2c1","order":1,"disp":true,"width":20,"collapse":false,"className":""},{"id":"b007859f7b041949","type":"ui_group","name":"Controle sala 302","tab":"c16b14bf1dceba15","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"c16b14bf1dceba15","type":"ui_tab","name":"Text","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"d725af890aebfeb2","type":"ui_group","name":"Realizar Login","tab":"2b0c9c70b6151dd8","order":1,"disp":true,"width":8,"collapse":false,"className":""},{"id":"2b0c9c70b6151dd8","type":"ui_tab","name":"Acesso IOT","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"6a4d510d.5de65","type":"ui_group","name":"Users","tab":"56715436.c2591c","order":2,"disp":true,"width":"9","collapse":false},{"id":"56715436.c2591c","type":"ui_tab","name":"Home Tab","icon":"dashboard","order":3},{"id":"dccab885436808de","type":"MySQLdatabase","name":"","host":"127.0.0.1","port":"3306","db":"logins","tz":"","charset":"UTF8"},{"id":"1c93cf44601c19bb","type":"MySQLdatabase","name":"","host":"127.0.0.1","port":"3306","db":"MES","tz":"","charset":"UTF8"},{"id":"8b1091aca6909763","type":"ui_spacer","z":"5f19424690f6a3ea","name":"spacer","group":"97db1e21f913b497","order":3,"width":20,"height":1},{"id":"7cdf06f72dfacdc0","type":"ui_spacer","z":"5f19424690f6a3ea","name":"spacer","group":"97db1e21f913b497","order":4,"width":20,"height":1},{"id":"91a8d43aa3c90eaf","type":"http request","z":"6d0f18521b8cb618","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://time.is/pt_br/Bras%C3%ADlia","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":230,"y":260,"wires":[["221d02a8676f81dd"]]},{"id":"1fdb6003f55899e5","type":"inject","z":"6d0f18521b8cb618","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":220,"wires":[["91a8d43aa3c90eaf"]]},{"id":"a583b7108bbfb1eb","type":"debug","z":"6d0f18521b8cb618","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":240,"y":340,"wires":[]},{"id":"221d02a8676f81dd","type":"html","z":"6d0f18521b8cb618","name":"","property":"","outproperty":"","tag":"#clock0_bg","ret":"text","as":"single","x":250,"y":300,"wires":[["a583b7108bbfb1eb"]]},{"id":"df255b6513e9b19e","type":"file in","z":"6d0f18521b8cb618","name":"image","filename":"C:\\Users\\Lucas\\Downloads\\mitsubishi_logo.png","filenameType":"str","format":"","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":330,"y":540,"wires":[[]]},{"id":"9695799f98dd97cc","type":"inject","z":"6d0f18521b8cb618","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":210,"y":500,"wires":[["df255b6513e9b19e"]]},{"id":"0d1704a145f67335","type":"ui_button","z":"5f19424690f6a3ea","name":"","group":"d725af890aebfeb2","order":2,"width":8,"height":1,"passthru":false,"label":"Realizar Login","tooltip":"Start the Login Process","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":200,"y":860,"wires":[["075357b768bcb3b3","be974ca4a25bd34f"]]},{"id":"be974ca4a25bd34f","type":"change","z":"5f19424690f6a3ea","name":"Initial Login","rules":[{"t":"set","p":"topic","pt":"msg","to":"Login","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Insira seu NIF para logar","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":100,"wires":[["f3617de9bbbc3137"]]},{"id":"fa6a5a4c9f0e9da7","type":"switch","z":"5f19424690f6a3ea","name":"Check Login","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Cancel","vt":"str"},{"t":"empty"},{"t":"eq","v":"sn1082504","vt":"str"},{"t":"eq","v":"sn1059974","vt":"str"},{"t":"nempty"}],"checkall":"false","repair":false,"outputs":5,"x":190,"y":460,"wires":[["2fc6ee35f2ac56bd"],["cf66a56d1c2710f6"],["464873fc62ab51fd","dfcea0d547e56b73"],["464873fc62ab51fd","dfcea0d547e56b73","2f1f3cb79202a95e"],[]]},{"id":"2fc6ee35f2ac56bd","type":"change","z":"5f19424690f6a3ea","name":"Login Cancelled","rules":[{"t":"set","p":"topic","pt":"msg","to":"O Login Falhou","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"O processo de login foi cancelado pelo usuário","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":380,"wires":[["041c1969c165a04d"]]},{"id":"041c1969c165a04d","type":"ui_toast","z":"5f19424690f6a3ea","position":"top right","displayTime":"3","highlight":"red","sendall":false,"outputs":0,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":910,"y":360,"wires":[]},{"id":"cf66a56d1c2710f6","type":"change","z":"5f19424690f6a3ea","name":"Login Failed","rules":[{"t":"set","p":"topic","pt":"msg","to":"O Login Falhou","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"O nome não pode estar vazio","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":440,"wires":[["69235bf5bc051e5a"]]},{"id":"69235bf5bc051e5a","type":"ui_toast","z":"5f19424690f6a3ea","position":"dialog","displayTime":"3","highlight":"red","sendall":false,"outputs":1,"ok":"Tentar Novamente?","cancel":"","raw":false,"className":"","topic":"","name":"","x":870,"y":440,"wires":[["be974ca4a25bd34f"]]},{"id":"dfcea0d547e56b73","type":"function","z":"5f19424690f6a3ea","name":"Login Complete Message","func":"// read text in msg.payload\nvar inp = msg.payload\nvar Gustavo_Arraias = \"Gustavo arraias\" \n// set notification text\n\nif (msg.payload== \"sn1059974\"){\n    inp = Gustavo_Arraias\n    msg.payload = \"Bem vindo \" + inp\n}\n\n// return msg Object\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":610,"y":560,"wires":[["1992d36734e6ad4e","6225bae67a8fc1a1"]]},{"id":"1992d36734e6ad4e","type":"ui_toast","z":"5f19424690f6a3ea","position":"top right","displayTime":"3","highlight":"green","sendall":false,"outputs":0,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":890,"y":560,"wires":[]},{"id":"5349531ebc593363","type":"debug","z":"5f19424690f6a3ea","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1140,"y":660,"wires":[]},{"id":"95fcec85d047d328","type":"ui_ui_control","z":"5f19424690f6a3ea","name":"","events":"all","x":900,"y":700,"wires":[[]]},{"id":"464873fc62ab51fd","type":"change","z":"5f19424690f6a3ea","name":"Login sucedido","rules":[{"t":"set","p":"topic","pt":"msg","to":"Sucesso","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Controle de lâmpada","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":660,"wires":[["95fcec85d047d328","5349531ebc593363"]]},{"id":"fc4437622aee822a","type":"change","z":"5f19424690f6a3ea","name":"Login Não correspondido","rules":[{"t":"set","p":"topic","pt":"msg","to":"O Login Falhou","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Digite um NIF válido ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":500,"wires":[["ba5c47ff06bc2e31"]]},{"id":"ba5c47ff06bc2e31","type":"ui_toast","z":"5f19424690f6a3ea","position":"dialog","displayTime":"3","highlight":"red","sendall":false,"outputs":1,"ok":"Tentar Novamente?","cancel":"","raw":false,"className":"","topic":"","name":"","x":870,"y":500,"wires":[["be974ca4a25bd34f"]]},{"id":"ecc792731dc8f218","type":"ui_button","z":"5f19424690f6a3ea","name":"","group":"97db1e21f913b497","order":1,"width":10,"height":2,"passthru":false,"label":"Ligar Lâmpada","tooltip":"White","color":"","bgcolor":"green","className":"","icon":"","payload":"true","payloadType":"bool","topic":"topic","topicType":"msg","x":560,"y":700,"wires":[["95fcec85d047d328"]]},{"id":"f214787bafe775c6","type":"ui_button","z":"5f19424690f6a3ea","name":"","group":"97db1e21f913b497","order":2,"width":10,"height":2,"passthru":false,"label":"Desligar Lâmpada","tooltip":"White","color":"","bgcolor":"Red","className":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":550,"y":740,"wires":[["95fcec85d047d328"]]},{"id":"f85f8a3970c92bc7","type":"ui_button","z":"5f19424690f6a3ea","name":"","group":"97db1e21f913b497","order":5,"width":20,"height":2,"passthru":false,"label":"Logout","tooltip":"White","color":"","bgcolor":"Purple","className":"","icon":"","payload":"Acesso IOT","payloadType":"str","topic":"topic","topicType":"msg","x":590,"y":780,"wires":[["95fcec85d047d328"]]},{"id":"f3617de9bbbc3137","type":"ui_toast","z":"5f19424690f6a3ea","position":"prompt","displayTime":"3","highlight":"red","sendall":false,"outputs":1,"ok":"OK","cancel":"Cancel","raw":false,"className":"","topic":"","name":"","x":750,"y":100,"wires":[["fa6a5a4c9f0e9da7"]]},{"id":"075357b768bcb3b3","type":"exec","z":"5f19424690f6a3ea","command":"cd C:\\Windows\\System32","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":450,"y":880,"wires":[["06395ecdc224e1e6"],[],[]]},{"id":"06395ecdc224e1e6","type":"exec","z":"5f19424690f6a3ea","command":"osk","addpay":"","append":"","useSpawn":"false","timer":"","winHide":false,"oldrc":false,"name":"","x":570,"y":1000,"wires":[["f3617de9bbbc3137"],[],[]]},{"id":"3319f0f70e5d7fdc","type":"debug","z":"5f19424690f6a3ea","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":1180,"wires":[]},{"id":"b30a67306c9e19fb","type":"inject","z":"5f19424690f6a3ea","name":"","props":[{"p":"payload.timer","v":"","vt":"date"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":190,"y":560,"wires":[["2f1f3cb79202a95e"]]},{"id":"2f1f3cb79202a95e","type":"function","z":"5f19424690f6a3ea","name":"function 1","func":"const timestamp = msg.payload.timer\nif(msg.payload == \"sn1059974\"){\n    return timestamp\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":600,"wires":[["3319f0f70e5d7fdc"]]},{"id":"c17ae72d5e5f37e0","type":"change","z":"5f19424690f6a3ea","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"$now()","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":1200,"wires":[["56fed3a6991a84d3"]]},{"id":"6225bae67a8fc1a1","type":"change","z":"5f19424690f6a3ea","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"sn1059974","fromt":"str","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":1140,"wires":[["c17ae72d5e5f37e0"]]},{"id":"bbe229c43d3a13a7","type":"mysql","z":"5f19424690f6a3ea","mydb":"dccab885436808de","name":"","x":990,"y":1380,"wires":[["3319f0f70e5d7fdc"]]},{"id":"56fed3a6991a84d3","type":"function","z":"5f19424690f6a3ea","name":"function 2","func":"const hora = msg.payload\nmsg.topic = 'INSERT INTO`logins`.`horarios de login`(`HorariosdeLogin`) VALUES(\"+hora+\")'\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1080,"y":1240,"wires":[["bbe229c43d3a13a7"]]},{"id":"656b1925bed741ce","type":"ui_toast","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","position":"prompt","displayTime":"3","highlight":"red","sendall":false,"outputs":1,"ok":"OK","cancel":"Cancel","raw":false,"className":"","topic":"","name":"","x":630,"y":240,"wires":[["965b5b00903ef038"]]},{"id":"1b91db2672fc7e4a","type":"change","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","name":"Initial Login","rules":[{"t":"set","p":"topic","pt":"msg","to":"Login","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Insira seu NIF para logar","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":240,"wires":[["656b1925bed741ce"]]},{"id":"965b5b00903ef038","type":"switch","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","name":"Check Login","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Cancel","vt":"str"},{"t":"empty"},{"t":"eq","v":"sn1082504","vt":"str"},{"t":"eq","v":"sn1059974","vt":"str"},{"t":"nempty"}],"checkall":"false","repair":false,"outputs":5,"x":270,"y":400,"wires":[["e63bdfbc27400376"],["7bec24dbb42dfb9b"],["521da51fa847192a","92539e1fdf7b0df6"],["521da51fa847192a","92539e1fdf7b0df6"],["515fd53333e238d9"]]},{"id":"e63bdfbc27400376","type":"change","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","name":"Login Cancelled","rules":[{"t":"set","p":"topic","pt":"msg","to":"O Login Falhou","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"O processo de login foi cancelado pelo usuário","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":300,"wires":[["e4a9d6af0566da27"]]},{"id":"e4a9d6af0566da27","type":"ui_toast","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","position":"top right","displayTime":"3","highlight":"red","sendall":false,"outputs":0,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":950,"y":300,"wires":[]},{"id":"7bec24dbb42dfb9b","type":"change","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","name":"Login Failed","rules":[{"t":"set","p":"topic","pt":"msg","to":"O Login Falhou","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"O nome não pode estar vazio","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":360,"wires":[["95f95493941a5d52"]]},{"id":"95f95493941a5d52","type":"ui_toast","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","position":"dialog","displayTime":"3","highlight":"red","sendall":false,"outputs":1,"ok":"Tentar Novamente ?","cancel":"","raw":false,"className":"","topic":"","name":"","x":930,"y":360,"wires":[["1b91db2672fc7e4a"]]},{"id":"92539e1fdf7b0df6","type":"function","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","name":"Login Complete Message","func":"// read text in msg.payload\nvar inp = msg.payload\nvar Gustavo_Arraias = \"Gustavo arraias\" \n// set notification text\n\nif (msg.payload== \"sn1059974\"){\n    inp = Gustavo_Arraias\n    msg.payload = \"Bem vindo \" + inp\n}\n\n// return msg Object\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":480,"wires":[["4fd00c9c1ded1b61"]]},{"id":"4fd00c9c1ded1b61","type":"ui_toast","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","position":"top right","displayTime":"3","highlight":"green","sendall":false,"outputs":0,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":950,"y":480,"wires":[]},{"id":"9766f6b16db70fb6","type":"change","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","name":"Initial Login","rules":[{"t":"set","p":"topic","pt":"msg","to":"Login","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Insira seu NIF para logar","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":780,"wires":[[]]},{"id":"21c11c7c6f8019f2","type":"debug","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","name":"debug 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":960,"y":580,"wires":[]},{"id":"07085de1d6e7d00d","type":"ui_ui_control","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","name":"","events":"all","x":960,"y":620,"wires":[[]]},{"id":"521da51fa847192a","type":"change","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","name":"Login sucedido","rules":[{"t":"set","p":"topic","pt":"msg","to":"Sucesso","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Home","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":600,"wires":[["21c11c7c6f8019f2","07085de1d6e7d00d"]]},{"id":"515fd53333e238d9","type":"change","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","name":"Login Não correspondido","rules":[{"t":"set","p":"topic","pt":"msg","to":"O Login Falhou","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Digite um NIF válido ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":420,"wires":[["b14c1c4d9b66fd73"]]},{"id":"b14c1c4d9b66fd73","type":"ui_toast","z":"cb956fffc8798827","g":"41e7b6bbcfa384fd","position":"dialog","displayTime":"3","highlight":"red","sendall":false,"outputs":1,"ok":"Tentar Novamente ?","cancel":"","raw":false,"className":"","topic":"","name":"","x":910,"y":420,"wires":[["1b91db2672fc7e4a"]]},{"id":"dc742398782aab73","type":"inject","z":"56c8cfd2451f355c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":340,"wires":[["07beb63e4e603c82"]]},{"id":"07beb63e4e603c82","type":"function","z":"56c8cfd2451f355c","name":"function 1","func":"msg.payload = {\n    \"timestamp\": new Date(),\n    \"value1\": 33,\n    \"value2\": 12\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":340,"wires":[["79b70be061685cef"]]},{"id":"79b70be061685cef","type":"debug","z":"56c8cfd2451f355c","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":730,"y":380,"wires":[]}]

As you only have 1 column try

INSERT INTO logins(HorariosdeLogin) VALUES(CURRENT_TIMESTAMP())

(remember to set the column to DATETIME in your schema)

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.