Solved

Opposite of CString::Format ?

Posted on 1998-06-06
1
329 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

697 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