diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 18:18:13 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 18:18:13 +0000 |
commit | bf37d6655a27cc3ea5af5412c9717596c9d1c30f (patch) | |
tree | 9a537b8cd5cd85b27b5a296f77a972a0ae0c3863 /plugins/IEView/src/TemplateHTMLBuilder.cpp | |
parent | d55f17dea8734cfb458fd8fcbac684d141b181af (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/TemplateHTMLBuilder.cpp')
-rw-r--r-- | plugins/IEView/src/TemplateHTMLBuilder.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index e63cfd2203..d7f5ecc85c 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -118,17 +118,12 @@ int TemplateHTMLBuilder::getFlags(ProtocolSettings * protoSettings) char *TemplateHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mode)
{
- static char szResult[512];
+ static char szResult[512]; szResult[0] = '\0';
TCHAR str[300];
- DBTIMETOSTRINGT dbtts;
- dbtts.cbDest = 70;
- dbtts.szDest = str;
- szResult[0] = '\0';
- if (mode) { //time
- dbtts.szFormat = (dwFlags & Options::LOG_SHOW_SECONDS) ? _T("s") : _T("t");
- CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, check, (LPARAM)&dbtts);
- }
- else {//date
+
+ if (mode) // time
+ TimeZone_ToStringT(check, (dwFlags & Options::LOG_SHOW_SECONDS) ? _T("s") : _T("t"), str, SIZEOF(str));
+ else { // date
struct tm tm_now, tm_today;
time_t now = time(NULL);
time_t today;
@@ -140,10 +135,8 @@ char *TemplateHTMLBuilder::timestampToString(DWORD dwFlags, time_t check, int mo _tcsncpy(str, TranslateT("Today"), SIZEOF(str));
else if (dwFlags & Options::LOG_RELATIVE_DATE && check > (today - 86400))
_tcsncpy(str, TranslateT("Yesterday"), SIZEOF(str));
- else {
- dbtts.szFormat = (dwFlags & Options::LOG_LONG_DATE) ? _T("D") : _T("d");
- CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, check, (LPARAM)& dbtts);
- }
+ else
+ TimeZone_ToStringT(check, (dwFlags & Options::LOG_LONG_DATE) ? _T("D") : _T("d"), str, SIZEOF(str));
}
mir_strncpy(szResult, T2Utf(str), 500);
|