summaryrefslogtreecommitdiff
path: root/plugins/IEView/src/MUCCHTMLBuilder.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-19 18:18:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-19 18:18:13 +0000
commitbf37d6655a27cc3ea5af5412c9717596c9d1c30f (patch)
tree9a537b8cd5cd85b27b5a296f77a972a0ae0c3863 /plugins/IEView/src/MUCCHTMLBuilder.cpp
parentd55f17dea8734cfb458fd8fcbac684d141b181af (diff)
timezone api migrated to mir_core
git-svn-id: http://svn.miranda-ng.org/main/trunk@14266 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src/MUCCHTMLBuilder.cpp')
-rw-r--r--plugins/IEView/src/MUCCHTMLBuilder.cpp36
1 files changed, 14 insertions, 22 deletions
diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp
index c34e794f41..7ac74ea989 100644
--- a/plugins/IEView/src/MUCCHTMLBuilder.cpp
+++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp
@@ -82,11 +82,7 @@ char *MUCCHTMLBuilder::timestampToString(DWORD dwData, time_t check)
{
static char szResult[512];
char str[80];
-
- DBTIMETOSTRING dbtts;
-
- dbtts.cbDest = 70;
- dbtts.szDest = str;
+ const char *szFormat;
szResult[0] = '\0';
struct tm tm_now, tm_today;
@@ -96,24 +92,20 @@ char *MUCCHTMLBuilder::timestampToString(DWORD dwData, time_t check)
tm_today = tm_now;
tm_today.tm_hour = tm_today.tm_min = tm_today.tm_sec = 0;
today = mktime(&tm_today);
- if (dwData&IEEDD_MUCC_SHOW_DATE && dwData&IEEDD_MUCC_SHOW_TIME) {
- if (dwData&IEEDD_MUCC_LONG_DATE) {
- dbtts.szFormat = dwData&IEEDD_MUCC_SECONDS ? (char *)"D s" : (char *)"D t";
- }
- else {
- dbtts.szFormat = dwData&IEEDD_MUCC_SECONDS ? (char *)"d s" : (char *)"d t";
- }
- }
- else if (dwData&IEEDD_MUCC_SHOW_DATE) {
- dbtts.szFormat = dwData&IEEDD_MUCC_LONG_DATE ? (char *)"D" : (char *)"d";
- }
- else if (dwData&IEEDD_MUCC_SHOW_TIME) {
- dbtts.szFormat = dwData&IEEDD_MUCC_SECONDS ? (char *)"s" : (char *)"t";
- }
- else {
- dbtts.szFormat = (char *)"";
+ if (dwData & IEEDD_MUCC_SHOW_DATE && dwData & IEEDD_MUCC_SHOW_TIME) {
+ if (dwData & IEEDD_MUCC_LONG_DATE)
+ szFormat = (dwData & IEEDD_MUCC_SECONDS) ? "D s" : "D t";
+ else
+ szFormat = (dwData & IEEDD_MUCC_SECONDS) ? "d s" : "d t";
}
- CallService(MS_DB_TIME_TIMESTAMPTOSTRING, check, (LPARAM)& dbtts);
+ else if (dwData & IEEDD_MUCC_SHOW_DATE)
+ szFormat = dwData & IEEDD_MUCC_LONG_DATE ? "D" : "d";
+ else if (dwData & IEEDD_MUCC_SHOW_TIME)
+ szFormat = dwData & IEEDD_MUCC_SECONDS ? "s" : "t";
+ else
+ szFormat = (char *)"";
+
+ TimeZone_ToString(check, szFormat, str, SIZEOF(str));
mir_strncat(szResult, str, SIZEOF(szResult) - mir_strlen(szResult));
mir_strncpy(szResult, ptrA(mir_utf8encode(szResult)), 500);
return szResult;