We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submitted by: @doychin
It will be great if there is a function from_unixtime that will convert unix time stamp in milliseconds to firebird timestamp.
This is a similar function for linux that returns string:
------------------------------ #include <stdio.h> #include <time.h> #include <stdlib.h>
char* from_unixtime(long long int*);
char* from_unixtime(t) long long int *t; { char* res = (char*)malloc(32);
long milis = *t % 1000; long tt = *t / 1000;
char tmp[32]; strftime(tmp, 32, "%Y-%m-%d %H:%M:%S", localtime(&tt));
sprintf(res, "%s:%d", tmp, milis);
return res; } --------------------------------- DECLARE EXTERNAL FUNCTION FROM_UNIXTIME BIGINT RETURNS CSTRING(100) FREE_IT ENTRY_POINT 'from_unixtime' MODULE_NAME 'unixTime'; ---------------------------------
There is similar function in MySQL.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Submitted by: @doychin
It will be great if there is a function from_unixtime that will convert unix time stamp in milliseconds to firebird timestamp.
This is a similar function for linux that returns string:
------------------------------
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
char* from_unixtime(long long int*);
char* from_unixtime(t)
long long int *t;
{
char* res = (char*)malloc(32);
long milis = *t % 1000;
long tt = *t / 1000;
char tmp[32];
strftime(tmp, 32, "%Y-%m-%d %H:%M:%S", localtime(&tt));
sprintf(res, "%s:%d", tmp, milis);
return res;
}
---------------------------------
DECLARE EXTERNAL FUNCTION FROM_UNIXTIME
BIGINT
RETURNS CSTRING(100) FREE_IT
ENTRY_POINT 'from_unixtime' MODULE_NAME 'unixTime';
---------------------------------
There is similar function in MySQL.
The text was updated successfully, but these errors were encountered: