Skip to content
Snippets Groups Projects
Commit f222665d authored by Mark Spencer's avatar Mark Spencer
Browse files

Fix timezone handling for FreeBSD

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 70007e60
No related branches found
No related tags found
No related merge requests found
...@@ -204,7 +204,11 @@ static void ...@@ -204,7 +204,11 @@ static void
packdate (unsigned char *o, time_t w) packdate (unsigned char *o, time_t w)
{ {
struct tm *t = localtime (&w); struct tm *t = localtime (&w);
#ifdef __FreeBSD__
int z = - t->tm_gmtoff / 3600 / 15;
#else
int z = timezone / 3600 / 15; int z = timezone / 3600 / 15;
#endif
*o++ = ((t->tm_year % 10) << 4) + (t->tm_year % 100) / 10; *o++ = ((t->tm_year % 10) << 4) + (t->tm_year % 100) / 10;
*o++ = (((t->tm_mon + 1) % 10) << 4) + (t->tm_mon + 1) / 10; *o++ = (((t->tm_mon + 1) % 10) << 4) + (t->tm_mon + 1) / 10;
*o++ = ((t->tm_mday % 10) << 4) + t->tm_mday / 10; *o++ = ((t->tm_mday % 10) << 4) + t->tm_mday / 10;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment