int main(void) { cout << "Now = " << now.get_date_string() << " " << now.get_time_string() << " and is day " << now.get_day_of_year() << "\n"; cout << "Birthday = " << birthday.get_date_string() << " " << birthday.get_time_string() << " and is day " << birthday.get_day_of_year() << "\n"; cout << "Special = " << special.get_date_string() << " " << special.get_time_string() << " and is day " << special.get_day_of_year() << "\n"; return 0; }
bool value::operator==(const datetime &comparand) const { return type_ == type::numeric && comparand.to_number(calendar::windows_1900) == numeric_value_; }
XLNT_FUNCTION void cell::set_value(datetime d) { d_->type_ = type::numeric; d_->value_numeric_ = d.to_number(get_base_date()); set_number_format(number_format::date_datetime()); }
int gap(datetime& dt) { return this->millisecs() - dt.millisecs(); }
void set(std::string const& name, datetime& value) { LNDatetimes item; item.SetValue(value.native()); detail::throw_error(note_->CreateItem(name.c_str(), item)); }
static void result(result_set_typ& result_, int i, datetime& var) { //sql_check(SQL_HANDLE_STMT, hstmt, SQLBindCol(hstmt, i, SQL_C_TIMESTAMP, // &var.value_, 0, &var.length_)); time_t t = static_cast<time_t>(result_->getInt(i)); var.value() = *std::gmtime( &t ); }