예제 #1
0
bool TimeFromS3Time(wxString str, wxDateTime & datetime)
{
	wxString::const_iterator end;
	const wxString fmt("%Y-%m-%dT%H:%M:%S.000Z");
	///FIXME: The date is in UTC, this reads it as some kind of local time... bleh. there could be bugs.
	return datetime.ParseFormat(str, fmt, &end);
}
예제 #2
0
bool mmParseDisplayStringToDate(wxDateTime& date, const wxString& sDate, const wxString &sDateMask)
{
    wxString mask = sDateMask;
    mask.Replace("%Y%m%d", "%Y %m %d");
    if (date_formats_regex().count(mask) == 0) return false;

    const wxString regex = date_formats_regex().at(mask);
    wxRegEx pattern(regex);
    //skip dot if present in pattern but not in date string 
    const wxString separator = mask.Mid(2,1);
    date.ParseFormat(sDate, mask, date);
    if (pattern.Matches(sDate) && sDate.Contains(separator))
        return true;
    else
    {
        //wxLogDebug("%s %s %i %s", sDate, mask, pattern.Matches(sDate), regex);
        return false;
    }
}