diff options
author | monty@mashka.mysql.fi <> | 2002-12-14 17:49:01 +0200 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2002-12-14 17:49:01 +0200 |
commit | d783e184369acf2cf40dc40b9d9cbd9db6c5189e (patch) | |
tree | 83ced56eeeb8e8fc8c70477eb454d5e43fb8cb56 /sql/time.cc | |
parent | ab70ad7c1ea73fa1764ddbb1177a796ef38ea654 (diff) | |
parent | d49167bae5cfd3419261e29558bc17d2d36ad94d (diff) | |
download | mariadb-git-d783e184369acf2cf40dc40b9d9cbd9db6c5189e.tar.gz |
merge
Diffstat (limited to 'sql/time.cc')
-rw-r--r-- | sql/time.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/time.cc b/sql/time.cc index 0811b896bfc..282075df9eb 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -724,3 +724,20 @@ bool str_to_time(const char *str,uint length,TIME *l_time) } return 0; } + + +/* + Convert a system time structure to TIME +*/ + +void localtime_to_TIME(TIME *to, struct tm *from) +{ + to->neg=0; + to->second_part=0; + to->year= (int) ((from->tm_year+1900) % 10000); + to->month= (int) from->tm_mon+1; + to->day= (int) from->tm_mday; + to->hour= (int) from->tm_hour; + to->minute= (int) from->tm_min; + to->second= (int) from->tm_sec; +} |