on getting time, fixed DST handling from "no dst" to "autodetect"

on setting time, push local time to remote currently


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14969 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2014-06-01 11:42:11 +00:00
parent 019efe9b5a
commit 39d7d2fe56

View File

@@ -5050,6 +5050,7 @@ _get_STR_as_time(CONFIG_GET_ARGS) {
strncpy (tmp, capture_date + 13, 2);
tmp[2] = 0;
tm.tm_sec = atoi (tmp);
tm.tm_isdst = -1; /* autodetect */
camtime = mktime(&tm);
gp_widget_set_value (*widget,&camtime);
return (GP_OK);
@@ -5070,9 +5071,10 @@ _put_STR_as_time(CONFIG_PUT_ARGS) {
if (ret != GP_OK)
return ret;
#ifdef HAVE_GMTIME_R
pxtm = gmtime_r (&camtime, &xtm);
memset(&xtm,0,sizeof(xtm));
pxtm = localtime_r (&camtime, &xtm);
#else
pxtm = gmtime (&camtime);
pxtm = localtime (&camtime);
#endif
/* 20020101T123400.0 is returned by the HP Photosmart */
sprintf(asctime,"%04d%02d%02dT%02d%02d%02d.0",pxtm->tm_year+1900,pxtm->tm_mon+1,pxtm->tm_mday,pxtm->tm_hour,pxtm->tm_min,pxtm->tm_sec);