Phenomena Posted September 23, 2013 Posted September 23, 2013 Is this possible gettimestr("%Y-%m-%d %H:%M:%S",21) -> gettimetick and back? Quote
Brian Posted September 23, 2013 Posted September 23, 2013 What format are your `start_date` and `end_date` columns? If they are YYYY-MM-DD HH:MM:SS then you should us FROM_UNIXTIME() to convert from UNIX timestamp to Date-Time format. 1 Quote
Brian Posted September 23, 2013 Posted September 23, 2013 You could use query_sql and MySQL's functions: FROM_UNIXTIME() UNIX_TIMESTAMP() Quote
Phenomena Posted September 23, 2013 Author Posted September 23, 2013 So, as i correctly check mysql manual: set .account_id, getcharid(3); query_sql "SELECT `userid` FROM `login` WHERE `account_id` = '"+ escape_sql( .account_id )+"'", .account_name$ ; set .start_time, gettimetick(2); set .end_time, .start_time + 600; // 10 minutes mes "[ Meneger ]"; mes "Account ID: " + .account_id; mes "Login: " + .account_name$; mes "Time start (UNIX): " + .start_time; mes "Time end (UNIX): " + .end_time; mes gettimestr("%Y-%m-%d %H:%M:%S",21); query_sql "INSERT INTO `account_type` ( `account_id`, `account_name`, `start_date`, `end_date`, `status` ) VALUES ( " + .account_id + ", '"+ escape_sql( .account_name$ )+"', UNIX_TIMESTAMP(" + .start_time + "), UNIX_TIMESTAMP(" + .end_time + "), 1 ) "; Is this correct? Quote
Phenomena Posted September 23, 2013 Author Posted September 23, 2013 (edited) CREATE TABLE IF NOT EXISTS `account_type` ( `account_id` int(11) unsigned NOT NULL default '0', `account_name` varchar(255) NOT NULL default 'NULL', `start_date` datetime NOT NULL default '0000-00-00 00:00:00', `end_date` datetime NOT NULL default '0000-00-00 00:00:00', `status` varchar(255) NOT NULL DEFAULT 'NULL', PRIMARY KEY (`account_id`)) ENGINE=MyISAM;start_date and end_date in %Y-%m-%d %H:%M:%S format,so its must be FROM_UNIXTIME(" + .start_time + ")? will try now... its work, will make some tests, thank you! Edited September 23, 2013 by Phenomena Quote
Question
Phenomena
Is this possible gettimestr("%Y-%m-%d %H:%M:%S",21) -> gettimetick and back?
4 answers to this question
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.