您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wcsftime函数代码示例

51自学网 2021-06-03 09:53:54
  C++
这篇教程C++ wcsftime函数代码示例写得很实用,希望能帮到您。

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

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

示例1: TimerProc

void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD){	for (auto &hContact : Contacts()) {		char *proto = GetContactProto(hContact);		if (proto && (db_get_b(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (db_get_b(hContact, MODULENAME, "StillAbsentNotified", 0) == 0))		{			db_set_b(hContact, MODULENAME, "StillAbsentNotified", 1);			Skin_PlaySound("buddyExpectatorStillAbsent");			wchar_t* message = TranslateT("has not returned after a long absence.");			time_t tmpTime;			wchar_t tmpBuf[251] = { 0 };			tmpTime = getLastSeen(hContact);			if (tmpTime != -1)			{				wcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));				message = tmpBuf;			}			else			{				tmpTime = getLastInputMsg(hContact);				if (tmpTime != -1)				{					wcsftime(tmpBuf, 250, TranslateT("has not returned after being absent since %#x"), gmtime(&tmpTime));					message = tmpBuf;				}			}			GoneNotify(hContact, message);		}	}}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:32,


示例2: formatString

    static inline String formatString (const String& format, const struct tm* const tm)    {       #if JUCE_ANDROID        typedef CharPointer_UTF8  StringType;       #elif JUCE_WINDOWS        typedef CharPointer_UTF16 StringType;       #else        typedef CharPointer_UTF32 StringType;       #endif        for (size_t bufferSize = 256; ; bufferSize += 256)        {            HeapBlock<StringType::CharType> buffer (bufferSize);           #if JUCE_ANDROID            const size_t numChars = strftime (buffer, bufferSize - 1, format.toUTF8(), tm);           #elif JUCE_WINDOWS            const size_t numChars = wcsftime (buffer, bufferSize - 1, format.toWideCharPointer(), tm);           #else            const size_t numChars = wcsftime (buffer, bufferSize - 1, format.toUTF32(), tm);           #endif            if (numChars > 0 || format.isEmpty())                return String (StringType (buffer),                               StringType (buffer) + (int) numChars);        }    }
开发者ID:AndrewCapon,项目名称:linnstrument-updater,代码行数:27,


示例3: formatString

    static inline String formatString (const String& format, const std::tm* const tm)    {       #if JUCE_ANDROID        typedef CharPointer_UTF8  StringType;       #elif JUCE_WINDOWS        typedef CharPointer_UTF16 StringType;       #else        typedef CharPointer_UTF32 StringType;       #endif       #ifdef JUCE_MSVC        if (tm->tm_year < -1900 || tm->tm_year > 8099)            return String();   // Visual Studio's library can only handle 0 -> 9999 AD        #endif        for (size_t bufferSize = 256; ; bufferSize += 256)        {            HeapBlock<StringType::CharType> buffer (bufferSize);            const size_t numChars =                           #if JUCE_ANDROID                            strftime (buffer, bufferSize - 1, format.toUTF8(), tm);                           #elif JUCE_WINDOWS                            wcsftime (buffer, bufferSize - 1, format.toWideCharPointer(), tm);                           #else                            wcsftime (buffer, bufferSize - 1, format.toUTF32(), tm);                           #endif            if (numChars > 0 || format.isEmpty())                return String (StringType (buffer),                               StringType (buffer) + (int) numChars);        }    }
开发者ID:410pfeliciano,项目名称:JUCE,代码行数:33,


示例4: main

intmain (void){  wchar_t buf[BUF_SIZE];  struct tm *tp;  time_t time_list[NUM_OF_DATES] = {	  500, 68200000, 694223999,	  694224000, 704900000, 705000000,	  705900000  };  char *locale_list[NUM_OF_LOCALES] = {	  "C",	  "fr_FR.ISO-8859-1",	  "ja_JP.UTF-8"  };  int result = 0, ddd, lll;  size_t n;  for (lll = 0; lll < NUM_OF_LOCALES; lll++) {	  printf ("/nUsing locale: %s/n", locale_list[lll]);	  char* set = setlocale(LC_ALL, locale_list[lll]);	  if (set == NULL) {		  printf ("FAILED!/n/n");		  continue;	  } else		  printf ("/n");	  for (ddd = 0; ddd < NUM_OF_DATES; ddd++) {		  tp = localtime(&time_list[ddd]);		  printf ("%ld corresponds to ", time_list[ddd]);		  n = wcsftime (buf, sizeof (buf) / sizeof (buf[0]),				L"%H:%M:%S  %Y-%m-%d%n", tp);		  if (n != 21) {			result = 1;			printf ("FAILED!/n");		  }		  printf ("%ls", buf);		  wcsftime (buf, sizeof (buf) / sizeof (buf[0]),			L"%tor, as %%D %%T: %D %T%n", tp);		  printf ("%ls", buf);		  wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%A (%a)%n", tp);		  printf ("The weekday was %ls", buf);		  wcsftime (buf, sizeof (buf) / sizeof (buf[0]), L"%B (%b) %Y%n", tp);		  /* glibc bug? forgets aigu from french february février		   * See s/printf (/wprintf (L/g */		  //wprintf (L"Month was %ls", buf);		  printf ("Month was %ls", buf);	  }  }  return result;}
开发者ID:Jaden-J,项目名称:uClibc,代码行数:55,


示例5: lock

void CAlarmMachine::SetAdemcoEvent(EventSource resource, 								   int ademco_event, int zone, int subzone,								   const time_t& timestamp, const time_t& recv_time,								   const ademco::char_array_ptr& xdata								   ){	AUTO_LOG_FUNCTION;	std::lock_guard<std::mutex> lock(_lock4AdemcoEventList);	ademco::AdemcoEventPtr ademcoEvent = std::make_shared<AdemcoEvent>(resource, ademco_event, zone, subzone, timestamp, recv_time, xdata);	if (EVENT_PRIVATE_EVENT_BASE <= ademco_event && ademco_event <= EVENT_PRIVATE_EVENT_MAX) {		// 内部事件立即处理	} else {#ifdef _DEBUG		wchar_t wtime[32] = { 0 };		struct tm tmtm;		localtime_s(&tmtm, &recv_time);		wcsftime(wtime, 32, L"%Y-%m-%d %H:%M:%S", &tmtm);		JLOG(L"param: %s/n", wtime);#endif		time_t now = time(nullptr);		auto iter = _ademcoEventFilter.begin();		while (iter != _ademcoEventFilter.end()) {			const ademco::AdemcoEventPtr& oldEvent = *iter;#ifdef _DEBUG			localtime_s(&tmtm, &now);			wcsftime(wtime, 32, L"%Y-%m-%d %H:%M:%S", &tmtm);			JLOG(L"now: %s/n", wtime);			localtime_s(&tmtm, &oldEvent->_recv_time);			wcsftime(wtime, 32, L"%Y-%m-%d %H:%M:%S", &tmtm);			JLOG(L"old: %s/n", wtime);#endif			if (now - oldEvent->_recv_time >= 6) {				_ademcoEventFilter.erase(iter);				iter = _ademcoEventFilter.begin();				continue;			} else if (oldEvent->operator== (*ademcoEvent)) {				JLOG(L"same AdemcoEvent, delete it. ademco_id %06d, event %04d, zone %03d, gg %02d/n", 					 _ademco_id, ademcoEvent->_event, ademcoEvent->_zone, ademcoEvent->_sub_zone);				_ademcoEventFilter.erase(iter);				_ademcoEventFilter.push_back(ademcoEvent);				return;			}			iter++;		}		_ademcoEventFilter.push_back(ademcoEvent);	}	HandleAdemcoEvent(ademcoEvent);}
开发者ID:captainwong,项目名称:AlarmCenterTestTools,代码行数:49,


示例6: format_file_time

/** * Format time of file * This function uses different date format string for recent and * old files * * @param __buf - buffer for result * @param __buf_size - size of buffer * @param __time - time of file */voidformat_file_time (wchar_t *__buf, size_t __buf_size, time_t __time){  wchar_t *format;  struct tm tm;  time_t now;  now = time (0);  /* Convert time_t to struct tm */  gmtime_r (&__time, &tm);  /* Get format for date string */  if (__time < now)    {      format = ((now - __time) < DEFAULT_RECENT_PAST * 3600) ?              DEFAULT_DATE_FORMAT : DEFAULT_OLD_DATE_FORMAT;    }  else    {      format = ((__time - now) < DEFAULT_RECENT_FUTURE * 3600) ?              DEFAULT_DATE_FORMAT : DEFAULT_OLD_DATE_FORMAT;    }  wcsftime (__buf, __buf_size, format, &tm);}
开发者ID:Nazg-Gul,项目名称:fm,代码行数:35,


示例7: wsprintf

void CPtnZler::OnMenuPattern(){	if (!IsBoardLegal())	{		window->MessageBox(L"盘面不合法", L"定形局", MB_ICONWARNING | MB_OK);		return;	}	if (window->MessageBox(L"确定以当前盘面进行创作?", L"定形局", MB_ICONQUESTION | MB_OKCANCEL) != IDOK)		return;	g_pGameTable->SetZlerBase(this);	g_pGameTable->SetAction(0);	//进入Pattern目录	TCHAR wcsPatternPath[_MAX_PATH];	wsprintf(wcsPatternPath, L"%s//Pattern", ModulePath);	if (_waccess(wcsPatternPath, 0) == -1)		_wmkdir(wcsPatternPath);	_wchdir(wcsPatternPath);	//创建文件夹	time_t t = time(NULL);	wcsftime(m_wcsTimeFolder, sizeof(m_wcsTimeFolder) / sizeof(TCHAR), L"%Y%m%d_%H%M%S", localtime(&t)); //Eg: 20130814_210517	_wmkdir(m_wcsTimeFolder);	//设置起始文件号	m_nFileNumber = 1;	if (!SavePtnTitle(wcsPatternPath))		return;	InitSwapRemain();	ProcessPattern(true);}
开发者ID:jason-shi,项目名称:ZGames,代码行数:31,


示例8: sizeof

BOOL CMiniDump::GetDumpFileName(std::wstring& strDump){	time_t timeExcep;	TCHAR szTime[64] = {0}, szPath[MAX_PATH] = {0};	TCHAR *pTmp;	// 创建dump文件夹	::GetModuleFileName(NULL, szPath, MAX_PATH * sizeof(TCHAR));    pTmp = wcschr(szPath, '//');	if (pTmp != NULL)		*pTmp = '/0';	strDump = pTmp;	strDump += L"Dump//";	CreateDirectory(strDump.c_str(), NULL);	// 获取时间,组成dump文件名	timeExcep = time(NULL);	 wcsftime(szTime, sizeof(szTime), L"%Y%m%d%H%M%S", localtime(&timeExcep));	 strDump += L"DumpFile_";	 strDump += szTime;	 strDump += L"_App";	 strDump += L".dmp";	return TRUE;}
开发者ID:Johance2,项目名称:ShareModule,代码行数:27,


示例9: debug

void debug(const wchar_t* format, ...){	wchar_t tmpbuf[128];	time_t rawtime;	struct tm timeinfo;	va_list valist;	if (!DEBUG && EXECUTE_FROM_GPE)		return;	time(&rawtime);	localtime_s(&timeinfo, &rawtime);	wcsftime(tmpbuf, 128, L"%Y-%m-%d %H:%M:%S ", &timeinfo);	va_start(valist, format);	if (!EXECUTE_FROM_GPE){		fwprintf_s(stdout, L"%ls", tmpbuf);		vfwprintf_s(stdout, format, valist);	}	if (debugfh != NULL && DEBUG) {		fwprintf_s(debugfh, L"%ls", tmpbuf);		vfwprintf_s(debugfh, format, valist);		fflush(debugfh);	}	va_end(valist);}
开发者ID:cleitet,项目名称:wpkg-gp,代码行数:26,


示例10: strftime_win32

/* * On win32, strftime() returns the encoding in CP_ACP, which is likely * different from SERVER_ENCODING. This is especially important in Japanese * versions of Windows which will use SJIS encoding, which we don't support * as a server encoding. * * Replace strftime() with a version that gets the string in UTF16 and then * converts it to the appropriate encoding as necessary. * * Note that this only affects the calls to strftime() in this file, which are * used to get the locale-aware strings. Other parts of the backend use * pg_strftime(), which isn't locale-aware and does not need to be replaced. */static size_tstrftime_win32(char *dst, size_t dstlen, const wchar_t *format, const struct tm *tm){	size_t	len;	wchar_t	wbuf[MAX_L10N_DATA];	int		encoding;	encoding = GetDatabaseEncoding();	len = wcsftime(wbuf, MAX_L10N_DATA, format, tm);	if (len == 0)		/* strftime call failed - return 0 with the contents of dst unspecified */		return 0;	len = WideCharToMultiByte(CP_UTF8, 0, wbuf, len, dst, dstlen, NULL, NULL);	if (len == 0)		elog(ERROR,			"could not convert string to UTF-8:error %lu", GetLastError());	dst[len] = '/0';	if (encoding != PG_UTF8)	{		char *convstr = pg_do_encoding_conversion(dst, len, PG_UTF8, encoding);		if (dst != convstr)		{			strlcpy(dst, convstr, dstlen);			len = strlen(dst);		}	}	return len;}
开发者ID:50wu,项目名称:gpdb,代码行数:45,


示例11: malloc

//##############################################################################//# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #//##############################################################################xString xTime::format(xString format){	int formatBaseSize = 16;	xchar* buffer;	size_t bufferSize;	for(int i = 1;;i++)	{		bufferSize = format.size() + (formatBaseSize * i);		buffer = (xchar*) malloc(bufferSize * sizeof(xchar));		buffer[0] = _T('/1');				#ifndef XTK_UNICODE			size_t ret = strftime(buffer,bufferSize,format.c_str(),&m_time);		#else			size_t ret = wcsftime(buffer,bufferSize,format.c_str(),&m_time);		#endif				if(((ret < bufferSize) && ret != 0) || (ret == 0 && buffer[0] == _T('/0')))		{			xString s(buffer,ret);			free((void*) buffer);			return s;		}	}}
开发者ID:BackupTheBerlios,项目名称:xtklib-svn,代码行数:28,


示例12: GenerateFileName

static void GenerateFileName(wchar_t* buffer, size_t length){    /* Generate the default filename from the current date */    __time64_t t = _time64(NULL);    struct tm* ltime = _localtime64(&t);    wcsftime(buffer, length, L"screenshot_%Y-%m-%d_%H-%M-%S.png", ltime);    free(ltime);}
开发者ID:rossy,项目名称:clearshot,代码行数:8,


示例13: Format

		std::wstring Format( const DateTimeType & dateTime, const std::wstring & format )		{			wchar_t buffer[Utils::DATE_TIME_MAX_SIZE + 1] = { 0 };			std::tm tm = boost::posix_time::to_tm( dateTime );			size_t length = wcsftime( buffer, Utils::DATE_TIME_MAX_SIZE, format.c_str(), &tm );			assert( length < Utils::DATE_TIME_MAX_SIZE );			return std::wstring( buffer, buffer + length );		}
开发者ID:DragonJoker,项目名称:DatabaseConnector,代码行数:8,


示例14: wcsftime

  void ceefit_call_spec FIXTURE::GetSummaryReport(DYNARRAY<SUMMARYITEM>& reportList)  {    SUMMARYITEM aItem;    aItem.Title = "Counts";    aItem.Value = CountsObj->ToString();    reportList.Add(aItem);    aItem.Title = "Input file";    aItem.Value = SummaryObj->InputFile;    reportList.Add(aItem);    wchar_t timeChar[128];    timeChar[0] = L'/0';    wcsftime(timeChar, 128, L"%a %b %d %H:%M:%S %X %Y", gmtime(&SummaryObj->InputUpdate));    aItem.Title = "Input last updated";    aItem.Value = timeChar;    reportList.Add(aItem);    aItem.Title = "Output file";    aItem.Value = SummaryObj->OutputFile;    reportList.Add(aItem);    timeChar[0] = L'/0';    wcsftime(timeChar, 128, L"%a %b %d %H:%M:%S %X %Y", gmtime(&SummaryObj->RunDate.time));    aItem.Title = "Run date";    aItem.Value = timeChar;    reportList.Add(aItem);    if(SummaryObj->RunElapsedTime != null)    {      aItem.Title = "Run elapsed time";      aItem.Value = SummaryObj->RunElapsedTime->ToString();      reportList.Add(aItem);    }    if(SummaryObj->CountsRun != null)    {      aItem.Title = "counts run";      aItem.Value = SummaryObj->CountsRun->ToString();      reportList.Add(aItem);    }  }
开发者ID:juherr,项目名称:fit,代码行数:45,


示例15: localtime_s

WCHAR *buildTimestampString(long long timestamp){    WCHAR *buffer = new WCHAR[60];	tm date;	timestamp /= 1000;    localtime_s(&date, &timestamp);	wcsftime(buffer, 60, L"%Y.%m.%d - %H:%M:%S", &date);    return buffer;}
开发者ID:macamdeoca,项目名称:whatsapp-viewer,代码行数:9,


示例16: microtime

void Log::endlog(Tlsdata &tlsd, Level clvl){    wchar_t buf[128];    time_t now_sec;    usec_t now_usec;    wstring &strbuf(tlsd.strbuf);    lck.Enter();    if (!ffd.open())        ffd.open(ffd.file());    ffd.lock();    now_usec = microtime();    now_sec = (unsigned)(now_usec / 1000000);    if (now_sec != last_sec)    {        wchar_t *p;        struct tm *tm;        tm = localtime(&now_sec);        wcsftime(buf, sizeof (buf) / sizeof (wchar_t), fmt, tm);        if (last_fmt != NULL)            free(last_fmt);        last_fmt = wcsdup(buf);        last_sec = now_sec;        p = wcsstr(last_fmt, USubst);        upos = p ? (int)(p - last_fmt) : -1;    }    strbuf = last_fmt;    if (upos != -1)    {        wsprintf(buf, L"%06u", (unsigned)(now_usec % 1000000));        strbuf.replace(upos, 2, buf);    }    if (!strbuf.empty())        strbuf += ' ';    strbuf += LevelStr[clvl];    if (clvl == Err)        strbuf += ' ';    strbuf += ' ';    if (!tlsd.prefix.empty())    {        strbuf += tlsd.prefix;        strbuf += ' ';    }    strbuf.append(tlsd.strm.str(), (unsigned)tlsd.strm.size());    if (strbuf.at(strbuf.length() - 1) != '/n') {        strbuf += '/r';        strbuf += '/n';    }    ffd.write(strbuf.c_str(), (unsigned)strbuf.size());    ffd.unlock();    lck.Leave();    tlsd.clvl = None;    tlsd.space = false;    tlsd.strm.reset();}
开发者ID:TaNhoSy,项目名称:zimbra-mirror,代码行数:56,


示例17: GetLocalCurrentTime

/// <summary>/// Helper function to retrieve the local current time/// </summary>inline PWCHAR GetLocalCurrentTime(PWCHAR buffer, UINT length){    __time64_t currentTime = _time64(nullptr);    tm localTime;    _localtime64_s(&localTime, &currentTime);    wcsftime(buffer, length, L"%#I:%M %p", &localTime);    return buffer;}
开发者ID:sterlingware,项目名称:starship,代码行数:13,


示例18: FileDescription

std::wstring FileDescription(const VfsFile& file){	wchar_t timestamp[25];	const time_t mtime = file.MTime();	wcsftime(timestamp, ARRAY_SIZE(timestamp), L"%a %b %d %H:%M:%S %Y", localtime(&mtime));	wchar_t buf[200];	swprintf_s(buf, ARRAY_SIZE(buf), L"(%c; %6lu; %ls) %ls", file.Loader()->LocationCode(), (unsigned long)file.Size(), timestamp, file.Name().string().c_str());	return buf;}
开发者ID:Gallaecio,项目名称:0ad,代码行数:10,


示例19: _wstrftime_ms

_WCRTLINK size_t _wstrftime_ms( CHAR_TYPE *s, size_t maxsize, const char *format, const struct tm *timeptr ){    wchar_t     *auto_buf;    int         length;    length = _mbslen( (unsigned char *)format ) + 1;    auto_buf = (wchar_t *)alloca( length * CHARSIZE );    mbstowcs( auto_buf, format, length );    return( wcsftime( s, maxsize, auto_buf, timeptr ) );}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:10,


示例20: localtime_s

LRESULT CLogSourceInfoDlg::OnInitDialog(HWND , LPARAM){	CDialogResize<CLogSourceInfoDlg>::DlgResize_Init();	m_list.SubclassWindow(GetDlgItem(IDC_LIST));	m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_HEADERDRAGDROP);	struct	{		LPCWSTR name;		int width;	}columnInfo[] =	{		L"进程", 160,		L"连接时间", 120, 		L"进程路径", 400,	};	for (int i = 0; i < _countof(columnInfo); i++)	{		m_list.AddColumn(columnInfo[i].name, i);		m_list.SetColumnWidth(i, columnInfo[i].width);	}	m_image.Create(16, 16, ILC_COLOR32|ILC_MASK, 2, 2);	m_list.SetImageList(m_image, LVSIL_SMALL);	int index = 0;	for (lsds_t::const_iterator it = m_lsds.begin(); it != m_lsds.end(); ++it, ++index)	{		int iconIndex = 0;		HICON hIcon = ::ExtractIconW(ModuleHelper::GetModuleInstance(), it->ppath, 0);		if (hIcon)		{			iconIndex = m_image.AddIcon(hIcon);			::DestroyIcon(hIcon);		}		m_list.AddItem(0, 0, L"", iconIndex);		struct tm tt;		localtime_s(&tt, &it->joinTime);		wchar_t timebuf[256];		wcsftime(timebuf, _countof(timebuf), L"%Y-%m-%d %H:%M:%S", &tt);		wchar_t pidbuf[1024];		swprintf_s(pidbuf, L"%s(%u)", (LPCWSTR)it->pname, it->pid);		m_list.SetItemText(0, 0, pidbuf);		m_list.SetItemText(0, 1, timebuf);		m_list.SetItemText(0, 2, it->ppath);	}	CenterWindow(GetParent());	return 0;}
开发者ID:timepp,项目名称:bdlog,代码行数:55,


示例21: doFTime

 int doFTime (CharPointer_UTF32 dest, const size_t maxChars, const String& format, const struct tm* const tm) noexcept {    #if JUCE_ANDROID     HeapBlock <char> tempDest;     tempDest.calloc (maxChars + 2);     const int result = (int) strftime (tempDest, maxChars, format.toUTF8(), tm);     if (result > 0)         dest.writeAll (CharPointer_UTF8 (tempDest.getData()));     return result;    #elif JUCE_WINDOWS     HeapBlock <wchar_t> tempDest;     tempDest.calloc (maxChars + 2);     const int result = (int) wcsftime (tempDest, maxChars, format.toWideCharPointer(), tm);     if (result > 0)         dest.writeAll (CharPointer_UTF16 (tempDest.getData()));     return result;    #else     return (int) wcsftime (dest.getAddress(), maxChars, format.toUTF32(), tm);    #endif }
开发者ID:sonic59,项目名称:JuceS1Text,代码行数:20,


示例22: operator

 template<class msg_type> void operator()(msg_type & msg) const {     char_type buffer[64];     ::time_t t = ::time (nullptr);     ::tm t_details = m_localtime ? *localtime( &t) : *gmtime( &t); #ifdef HPX_LOG_USE_WCHAR_T     if (0 != wcsftime (buffer, sizeof (buffer), m_format.c_str (), &t_details)) #else     if (0 != strftime (buffer, sizeof (buffer), m_format.c_str (), &t_details)) #endif         convert::write(buffer, msg); }
开发者ID:7ev3n,项目名称:hpx,代码行数:11,


示例23: get_current_timestamp

std::wstring get_current_timestamp(){	const time_t raw_time = time(nullptr);	tm local_time;	localtime_s(&local_time, &raw_time);	std::wstring buffer;	buffer.resize(100);	wcsftime(&buffer[0], buffer.size(), L"[%H:%M:%S]", &local_time);	return buffer;}
开发者ID:ivarboms,项目名称:focus-log,代码行数:11,


示例24: wcsftime

CStringW CTime::FormatGmt(LPCWSTR pFormat) const{	CStringW str;	struct tm Time;	if (localtime_s(&Time,&m_time))		return szEmpty;	wcsftime(str.GetBuffer(1000),1000,pFormat,&Time);	str.FreeExtra();	return str;}
开发者ID:quachdnguyen,项目名称:locate-src,代码行数:11,


示例25: __internal_to_string

String __internal_to_string(struct tm time){   // YYYY-MM-DD hh:mm:ss#ifndef HX_UTF8_STRINGS   wchar_t buf[100];   wcsftime(buf,100,L"%Y-%m-%d %H:%M:%S", &time);#else   char buf[100];   strftime(buf,100, "%Y-%m-%d %H:%M:%S", &time);#endif   return String(buf).dup();}
开发者ID:CapturaCamera,项目名称:hxcpp,代码行数:13,


示例26: __hxcpp_to_string

String __hxcpp_to_string(double inSeconds){   time_t t = (time_t)inSeconds;   struct tm *time = localtime(&t);#ifndef HX_UTF8_STRINGS   wchar_t buf[100];   wcsftime(buf,100,L"%Y-%m-%d %H:%M:%S", time);#else   char buf[100];   strftime(buf,100,"%Y-%m-%d %H:%M:%S", time);#endif   return String(buf).dup();}
开发者ID:bradparks,项目名称:hxcpp,代码行数:13,


示例27: TEST

TEST(wchar, wcsftime) {  setenv("TZ", "UTC", 1);  struct tm t;  memset(&t, 0, sizeof(tm));  t.tm_year = 200;  t.tm_mon = 2;  t.tm_mday = 10;  wchar_t buf[64];  EXPECT_EQ(24U, wcsftime(buf, sizeof(buf), L"%c", &t));  EXPECT_STREQ(L"Sun Mar 10 00:00:00 2100", buf);}
开发者ID:happyroom99,项目名称:platform_bionic,代码行数:14,


示例28: timeToString

/** * Converts a date/time into a human-readable string * using the ISO 8601 standard. * @param time Value in timestamp format. * @return String pair with date and time. */std::pair<std::wstring, std::wstring> timeToString(time_t time){	wchar_t localDate[25], localTime[25];/*#ifdef _WIN32	LARGE_INTEGER li;	li.QuadPart = time;	FILETIME ft;	ft.dwHighDateTime = li.HighPart;	ft.dwLowDateTime = li.LowPart;	SYSTEMTIME st;	FileTimeToLocalFileTime(&ft, &ft);	FileTimeToSystemTime(&ft, &st);	GetDateFormatW(LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, localDate, 25);	GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, localTime, 25);#endif*/	struct tm *timeinfo = localtime(&(time));	wcsftime(localDate, 25, L"%Y-%m-%d", timeinfo);	wcsftime(localTime, 25, L"%H:%M", timeinfo);	return std::make_pair(localDate, localTime);}
开发者ID:BHSDuncan,项目名称:OpenXcom,代码行数:30,



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


C++ wcslen函数代码示例
C++ wcserr_set函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。