Solved

Opposite of CString::Format ?

Posted on 1998-06-06
1
330 Views
Last Modified: 2013-12-03
CString oTime;
SYSTEMTIME st;
oTime.Format("%02d/%02d/%04d %02d:%02d PM",st.wDay, st.wMonth, st.wYear,st.wHour-12, st.wMinute);      

Is there any simple way to "Un"Format a CString and get back all values to a SYSTEMTIME structure? I need
this structure to do sorting. I don't think I want to manually extracts the value from the CString one by one and
make comparison between the years...then months..... it's extremely tedious.. I believe there is a simpler way to
do that, could anyone please enlighten me?
0
Comment
Question by:zhenteng
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
Slarti earned 10 total points
ID: 1407072
Use sscanf:
sscanf((const char*)oTime, "%d %d etc.", &st.wDay, &st.wMonth ...);
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question