当前位置: 首页>>代码示例>>C++>>正文


C++ wxDateTime类代码示例

本文整理汇总了C++中wxDateTime的典型用法代码示例。如果您正苦于以下问题:C++ wxDateTime类的具体用法?C++ wxDateTime怎么用?C++ wxDateTime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了wxDateTime类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetRange

void wxDatePickerCtrl::SetRange(const wxDateTime& dt1, const wxDateTime& dt2)
{
    SYSTEMTIME st[2];

    DWORD flags = 0;
    if ( dt1.IsValid() )
    {
        dt1.GetAsMSWSysTime(st + 0);
        flags |= GDTR_MIN;
    }

    if ( dt2.IsValid() )
    {
        dt2.GetAsMSWSysTime(st + 1);
        flags |= GDTR_MAX;
    }

    if ( !DateTime_SetRange(GetHwnd(), flags, st) )
    {
        wxLogDebug(wxT("DateTime_SetRange() failed"));
        return;
    }

    // Setting the range could have changed the current control value if the
    // old one wasn't inside the new range, so update it.
    m_date = MSWGetControlValue();
}
开发者ID:nE0sIghT,项目名称:wxWidgets,代码行数:27,代码来源:datectrl.cpp

示例2: DateToStr

wxString DateToStr(const wxDateTime &datetime)
{
	if (!datetime.IsValid())
		return wxEmptyString;

	return datetime.FormatDate() + wxT(" ") + datetime.FormatTime();
}
开发者ID:swflb,项目名称:pgadmin3,代码行数:7,代码来源:misc.cpp

示例3: addDate

INLINE 
void  wxeReturn::addDate(wxDateTime dateTime) {
    addInt(dateTime.GetYear());
    addInt(dateTime.GetMonth()+1); // c++ month is zero based
    addInt(dateTime.GetDay());
    addTupleCount(3);
}
开发者ID:AlainODea,项目名称:otp,代码行数:7,代码来源:wxe_return.cpp

示例4: Run

bool CUpdater::Run()
{
	if( state_ != UpdaterState::idle && state_ != UpdaterState::failed &&
		state_ != UpdaterState::newversion && state_ != UpdaterState::newversion_ready )
	{
		return false;
	}

	wxDateTime const t = wxDateTime::Now();
	COptions::Get()->SetOption(OPTION_UPDATECHECK_LASTDATE, t.Format(_T("%Y-%m-%d %H:%M:%S")));

	local_file_.clear();
	log_ = wxString::Format(_("Started update check on %s\n"), t.Format());

	wxString build = CBuildInfo::GetBuildType();
	if( build.empty() ) {
		build = _("custom");
	}
	log_ += wxString::Format(_("Own build type: %s\n"), build);

	SetState(UpdaterState::checking);

	m_use_internal_rootcert = true;
	int res = Download(GetUrl(), wxString());

	if (res != FZ_REPLY_WOULDBLOCK) {
		SetState(UpdaterState::failed);
	}
	raw_version_information_.clear();

	return state_ == UpdaterState::checking;
}
开发者ID:juaristi,项目名称:filezilla,代码行数:32,代码来源:updater.cpp

示例5: saveData

void HumanoidDataLogger::saveData()
{
	const wxDateTime now = wxDateTime::UNow();
	
	wxString dataDirectory(dataSaveDirectory.c_str(),wxConvUTF8);
	wxString curFilePath = dataDirectory + wxT("/recentData.dat");
	
	dataDirectory += now.FormatISODate();
	wxString dataFile =  now.FormatISODate() + wxT("_") + now.FormatISOTime() + wxT(".dat");
	dataFile.Replace(wxT(":"), wxT("-"));
	
	wxString dataPath = dataDirectory + wxT("/") + dataFile;
	
	if(! wxDirExists(dataDirectory))
	{
		wxMkdir(dataDirectory);	
	}
	
	stringstream ss;
	ss << dataPath.mb_str();
	setFile(ss.str());
	writeRecords();
	
	FILE * curFile = fopen(curFilePath.mb_str(),"w");
	fprintf(curFile, "%s",ss.str().c_str());
	fclose(curFile);
}
开发者ID:idanceyang,项目名称:DynaMechs,代码行数:27,代码来源:HumanoidDataLogger.cpp

示例6: eDocumentPath_shouldUpdateCygwin

//
// Returns true if this Cygwin installation should be updated (or installed for the first time.)
// Returns false if we are up-to-date.
//
bool eDocumentPath_shouldUpdateCygwin(wxDateTime &stampTime, const wxFileName &supportFile){
	// E's support folder comes with a network installer for Cygwin.
	// Newer versions of E may come with newer Cygwin versions.
	// If the user already has Cygwin installed, we still check the
	// bundled installer to see if it is newer; if so, then we need to
	// re-install Cygwin at the newer version.

	if (!stampTime.IsValid())
		return true; // First time, so we need to update.

	wxDateTime updateTime = supportFile.GetModificationTime();

	// Windows doesn't store milliseconds; we clear out this part of the time.
	updateTime.SetMillisecond(0);
	updateTime.SetSecond(0);

	stampTime.SetMillisecond(0);
	stampTime.SetSecond(0);

	// If the times are the same, no update needed.
	if (updateTime == stampTime)
		return false;

	// ...else the dates differ and we need to update.
	wxLogDebug(wxT("InitCygwin: Diff dates"));
	wxLogDebug(wxT("  e-postinstall: %s"), updateTime.FormatTime());
	wxLogDebug(wxT("  last-e-update: %s"), stampTime.FormatTime());
	return true;
}
开发者ID:joeri,项目名称:e,代码行数:33,代码来源:eDocumentPath.cpp

示例7: SetUtcTime

void DashboardInstrument_Moon::SetUtcTime( wxDateTime data )
{
    if (data.IsValid())
    {
        m_phase = moon_phase(data.GetYear(), data.GetMonth() + 1, data.GetDay());
    }
}
开发者ID:mookiejones,项目名称:OpenCPN,代码行数:7,代码来源:clock.cpp

示例8: wxQtConvertDate

QDate wxQtConvertDate(const wxDateTime& date)
{
    if ( date.IsValid() )
        return QDate(date.GetYear(), date.GetMonth() + 1, date.GetDay());
    else
        return QDate();
}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:7,代码来源:converter.cpp

示例9: SetCreateTime

void TrackPoint::SetCreateTime( wxDateTime dt )
{
    wxString ts;
    if(dt.IsValid())
        ts = dt.FormatISODate().Append(_T("T")).Append(dt.FormatISOTime()).Append(_T("Z"));

    SetCreateTime(ts);
}
开发者ID:SamsonovAnton,项目名称:OpenCPN,代码行数:8,代码来源:Track.cpp

示例10: pgsRandomizer

pgsDateTimeGen::pgsDateTimeGen(wxDateTime min, wxDateTime max,
		const bool & sequence, const long & seed) :
	pgsObjectGen(seed), m_min(min.IsEarlierThan(max) || min.IsEqualTo(max) ? min : max),
			m_max(max.IsLaterThan(min) || max.IsEqualTo(min) ? max : min),
			m_range(m_max.Subtract(m_min).GetSeconds()), m_sequence(sequence)
{
	m_randomizer = pgsRandomizer(pnew pgsIntegerGen(0, std::string(m_range
			.ToString().mb_str()).c_str(), is_sequence(), m_seed));
}
开发者ID:xiul,项目名称:Database-Designer-for-pgAdmin,代码行数:9,代码来源:pgsDateTimeGen.cpp

示例11: FormatDateLong

wxString FormatDateLong( const wxDateTime &aDate )
{
    /* GetInfo was introduced only on wx 2.9; for portability reason an
     * hardcoded format is used on wx 2.8 */
#if wxCHECK_VERSION( 2, 9, 0 )
    return aDate.Format( wxLocale::GetInfo( wxLOCALE_LONG_DATE_FMT ) );
#else
    return aDate.Format( wxT("%d %b %Y") );
#endif
}
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:10,代码来源:common.cpp

示例12: MakeDateTimeLabel

wxString otcurrentUIDialog::MakeDateTimeLabel(wxDateTime myDateTime)
{			
    const wxString dateLabel(myDateTime.Format( _T( "%a") ));
    m_staticTextDatetime->SetLabel(dateLabel);
    
    m_datePickerDate->SetValue(myDateTime.GetDateOnly());
    m_timePickerTime->SetTime(myDateTime.GetHour(),myDateTime.GetMinute(), myDateTime.GetSecond());

    return dateLabel;
}
开发者ID:Rasbats,项目名称:otcurrent_pi,代码行数:10,代码来源:otcurrentUIDialog.cpp

示例13: SetDateToEndOfYear

void mmReportBudget::SetDateToEndOfYear(const int day, const int month, wxDateTime& date, bool isEndDate) const
{
    date.SetDay(day);
    date.SetMonth((wxDateTime::Month)month);
    if (isEndDate)
    {
        date.Subtract(wxDateSpan::Day());
        date.Add(wxDateSpan::Year());
    }
}
开发者ID:vomikan,项目名称:moneymanagerex,代码行数:10,代码来源:budget.cpp

示例14: RoundDateToSpan

wxDateTime RoundDateToSpan(wxDateTime date, wxDateSpan span)
{
    wxDateTime::wxDateTime_t day = date.GetDay();
    int month = MonthNum(date.GetMonth());
    wxDateTime::wxDateTime_t year = date.GetYear();

    wxDateTime::wxDateTime_t modDays = Mod(day - 1, span.GetTotalDays());
    wxDateTime::wxDateTime_t modMonths = Mod(month - 1, span.GetMonths());
    wxDateTime::wxDateTime_t modYears = Mod(year, span.GetYears());

    return wxDateTime(day - modDays, MonthFromNum(month - modMonths), year - modYears);
}
开发者ID:lukecian,项目名称:wxfreechart,代码行数:12,代码来源:compdateaxis.cpp

示例15: pgsObjectGen

pgsTimeGen::pgsTimeGen(wxDateTime min, wxDateTime max, const bool & sequence,
		const long & seed) :
	pgsObjectGen(seed), m_min(min.IsEarlierThan(max) || min.IsEqualTo(max) ? min : max),
			m_max(max.IsLaterThan(min) || max.IsEqualTo(min) ? max : min),
			m_range(m_max.Subtract(m_min).GetSeconds()), m_sequence(sequence)
{
	m_min.SetYear(1970); // We know this date is not a DST date
	m_min.SetMonth(wxDateTime::Jan);
	m_min.SetDay(1);
	m_randomizer = pgsRandomizer(pnew pgsIntegerGen(0, std::string(m_range
			.ToString().mb_str()).c_str(), is_sequence(), m_seed));
}
开发者ID:lhcezar,项目名称:pgadmin3,代码行数:12,代码来源:pgsTimeGen.cpp


注:本文中的wxDateTime类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。