summaryrefslogtreecommitdiff
path: root/plugins/TipperYM/src/translations.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/TipperYM/src/translations.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/TipperYM/src/translations.cpp')
-rw-r--r--plugins/TipperYM/src/translations.cpp50
1 files changed, 17 insertions, 33 deletions
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp
index 12ac692831..e492d4bbf8 100644
--- a/plugins/TipperYM/src/translations.cpp
+++ b/plugins/TipperYM/src/translations.cpp
@@ -70,59 +70,43 @@ TCHAR *NullTranslation(MCONTACT hContact, const char *szModuleName, const char *
return NULL;
}
-TCHAR *TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
- if (ts == 0) return 0;
+ if (ts == 0)
+ return 0;
- DBTIMETOSTRINGT dbt = {0};
- dbt.cbDest = bufflen;
- dbt.szDest = buff;
- dbt.szFormat = _T("d");
- CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt);
- return buff;
+ return TimeZone_ToStringT(ts, _T("d"), buff, bufflen);
}
-TCHAR *TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
- if (ts == 0) return 0;
+ if (ts == 0)
+ return 0;
- DBTIMETOSTRINGT dbt = {0};
- dbt.cbDest = bufflen;
- dbt.szDest = buff;
- dbt.szFormat = _T("D");
- CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt);
- return buff;
+ return TimeZone_ToStringT(ts, _T("D"), buff, bufflen);
}
-TCHAR *TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
- if (ts == 0) return 0;
+ if (ts == 0)
+ return 0;
- DBTIMETOSTRINGT dbt = {0};
- dbt.cbDest = bufflen;
- dbt.szDest = buff;
- dbt.szFormat = _T("s");
- CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt);
- return buff;
+ return TimeZone_ToStringT(ts, _T("s"), buff, bufflen);
}
-TCHAR *TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
- if (ts == 0) return 0;
+ if (ts == 0)
+ return 0;
- DBTIMETOSTRINGT dbt = {0};
- dbt.cbDest = bufflen;
- dbt.szDest = buff;
- dbt.szFormat = _T("t");
- CallService(MS_DB_TIME_TIMESTAMPTOSTRINGT, (WPARAM)ts, (LPARAM)&dbt);
- return buff;
+ return TimeZone_ToStringT(ts, _T("t"), buff, bufflen);
}
-TCHAR *TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
+TCHAR* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
DWORD t = (DWORD)time(0);