Fix for bug 127028: Daylight saving adjustment was miscalculated

git-svn-id: svn://10.0.0.236/trunk@116876 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mostafah%oeone.com 2002-03-19 21:12:45 +00:00
parent c91a3ffcf9
commit f3d7e6df08

View File

@ -76,9 +76,6 @@ icaltimetype ConvertFromPrtime( PRTime indate ) {
PRTime ConvertToPrtime ( icaltimetype indate ) {
PRExplodedTime ext;
PR_ExplodeTime( PR_Now(), PR_LocalTimeParameters, &ext);
ext.tm_year = indate.year;
ext.tm_month = indate.month - 1;
ext.tm_mday = indate.day;
@ -86,8 +83,19 @@ PRTime ConvertToPrtime ( icaltimetype indate ) {
ext.tm_min = indate.minute;
ext.tm_sec = indate.second;
ext.tm_usec = 0;
ext.tm_params.tp_gmt_offset = 0;
ext.tm_params.tp_dst_offset = 0;
PRTime result = PR_ImplodeTime( &ext );
PR_ExplodeTime( result, PR_LocalTimeParameters, &ext);
ext.tm_year = indate.year;
ext.tm_month = indate.month - 1;
ext.tm_mday = indate.day;
ext.tm_hour = indate.hour;
ext.tm_min = indate.minute;
ext.tm_sec = indate.second;
ext.tm_usec = 0;
result = PR_ImplodeTime( &ext );
PRInt64 usecpermsec;
LL_I2L( usecpermsec, PR_USEC_PER_MSEC );
LL_DIV( result, result, usecpermsec );