summaryrefslogtreecommitdiff
path: root/sql/time.cc
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-12-14 17:49:01 +0200
committermonty@mashka.mysql.fi <>2002-12-14 17:49:01 +0200
commitd783e184369acf2cf40dc40b9d9cbd9db6c5189e (patch)
tree83ced56eeeb8e8fc8c70477eb454d5e43fb8cb56 /sql/time.cc
parentab70ad7c1ea73fa1764ddbb1177a796ef38ea654 (diff)
parentd49167bae5cfd3419261e29558bc17d2d36ad94d (diff)
downloadmariadb-git-d783e184369acf2cf40dc40b9d9cbd9db6c5189e.tar.gz
merge
Diffstat (limited to 'sql/time.cc')
-rw-r--r--sql/time.cc17
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;
+}