Daggos Posted September 13, 2020 Share Posted September 13, 2020 Hi, I cant get the date to work when logging alarms to database im using mariadb mysql this is what i get 0000-00-00 test Test;Test; 4 F with the logging sets i have set Custom Time Formatting to %Y%m%d%H%M%S , but i cant do that with alarms. -- -- Table structure for table `alarmlog` -- CREATE TABLE `alarmlog` ( `TheTime` date DEFAULT NULL, `Name` text DEFAULT NULL, `Description` text DEFAULT NULL, `Priority` tinytext DEFAULT NULL, `Status` tinytext DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; COMMIT; Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted September 13, 2020 Share Posted September 13, 2020 It posts the time in Excel time format, meaning as a number that is decimal days since 1900. This is what worked on the databases we tested when this was first added, but obviously appears to not always work. You have two options: 1) change "TheTime" to a floating point instead of date. Then it should post correctly, but of course then the time stamp will be a number instead of something human readable. You also might try setting TheTime to datetime instead of just date. 2) log alarms yourself using the alarm events and a sequence function to do the logging and db. functions. This will allow you to log however you want. The only challenge is that you have to go through all of your alarms and add a line of script for each of the 3 events you want to log. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.