Opened 10 years ago

#7572 new Bugs

boost::gregorian::to_tm() does not fill in tm_gmtoff and tm_zone fields of the resulting std::tm structure

Reported by: izimenkov@… Owned by: az_sw_dude
Milestone: To Be Determined Component: date_time
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

On Fedora 15 (and maybe on other OSes), std::tm contains fields describing the time zone:

#ifdef	__USE_BSD
  long int tm_gmtoff;		/* Seconds east of UTC.  */
  __const char *tm_zone;	/* Timezone abbreviation.  */
#else
  long int __tm_gmtoff;		/* Seconds east of UTC.  */
  __const char *__tm_zone;	/* Timezone abbreviation.  */
#endif

boost::gregorian::to_tm() (and boost::posix_time::to_tm() respectively) does not fill in these fields. So these fields contain garbage. Other code can be misleaded with values of these uninitialized fields.

Change History (0)

Note: See TracTickets for help on using tickets.