Fix timezone handling for FreeBSD

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer 2004-05-15 22:52:12 +00:00
parent 70007e6095
commit f222665d1d
1 changed files with 4 additions and 0 deletions

View File

@ -204,7 +204,11 @@ static void
packdate (unsigned char *o, time_t w)
{
struct tm *t = localtime (&w);
#ifdef __FreeBSD__
int z = - t->tm_gmtoff / 3600 / 15;
#else
int z = timezone / 3600 / 15;
#endif
*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_mday % 10) << 4) + t->tm_mday / 10;