Mercurial > pidgin.yaz
comparison libpurple/protocols/mxit/profile.c @ 31974:6d3ba10e3f48
Use purple_str_to_time() instead of strptime(), which doesn't exist on Windows.
The previous commit (b71c7d50a44b91ee81c9a3f3409941a5457d5e90) is needed for
this to work correctly.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 02 May 2011 15:39:57 +0000 |
parents | 6b59dd656fee |
children | bb4eaf8e70d6 |
comparison
equal
deleted
inserted
replaced
31973:1e1b598c725e | 31974:6d3ba10e3f48 |
---|---|
122 t = time(NULL); | 122 t = time(NULL); |
123 localtime_r( &t, &now ); | 123 localtime_r( &t, &now ); |
124 | 124 |
125 /* decode hdate */ | 125 /* decode hdate */ |
126 memset( &bdate, 0, sizeof( struct tm ) ); | 126 memset( &bdate, 0, sizeof( struct tm ) ); |
127 strptime( date, "%Y-%m-%d", &bdate ); | 127 purple_str_to_time(date, FALSE, &bdate, NULL, NULL); |
128 | 128 |
129 /* calculate difference */ | 129 /* calculate difference */ |
130 age = now.tm_year - bdate.tm_year; | 130 age = now.tm_year - bdate.tm_year; |
131 if ( now.tm_mon < bdate.tm_mon ) /* is before month of birth */ | 131 if ( now.tm_mon < bdate.tm_mon ) /* is before month of birth */ |
132 age--; | 132 age--; |