예제 #1
0
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;
}
예제 #2
0
파일: value.cpp 프로젝트: omegaluo/xlnt
bool value::operator==(const datetime &comparand) const
{
    return type_ == type::numeric && comparand.to_number(calendar::windows_1900) == numeric_value_;
}
예제 #3
0
파일: cell.cpp 프로젝트: fhaoquan/xlnt
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());
}
예제 #4
0
	int gap(datetime& dt) {
		return this->millisecs() - dt.millisecs();
	}
예제 #5
0
 void set(std::string const& name, datetime& value)
 {
   LNDatetimes item;
   item.SetValue(value.native());
   detail::throw_error(note_->CreateItem(name.c_str(), item));
 }
예제 #6
0
 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 );
 }