Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8251223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:09:55+00:00 2026-06-08T00:09:55+00:00

I have an imput .txt file, which contains a date. The date is in

  • 0

I have an imput .txt file, which contains a date. The date is in the form DDMONYY, as in 08JUN98 or 16NOV05. I need to compare this date to the creation date of the file, and see which is sooner.

FILETIME seems like the appropriate form, especially since there is a CompareFileTime function. However, I have a problem converting the date into file time.

I can extract the date from the file and convert it into numbers (days 1-31, month 1-12, year 1900-20whatever) so I don’t need help with that, but feel free to comment on it anyway.

The real problem is that I can’t figure out how to get these values into a FILETIME format. Right now I have them as three different strings(or int’s if that helps more) one for day, month and year. If you could help me make the jump from string to FILETIME that would be great.

Or, if there is a completely better way that I missed during my research, please feel free to suggest it.

If you want, I can post what I have, but I don’t think it’ll help since it’s only getting to the string/int’s.


if it makes it any clearer, the values I have in my variables at this point, for May 3rd, 2002, would be something along the lines of

string day = "03";
string month ="5";
string year = "2002;
int dayint = 3;
int monthint = 5;
int yearint = 2002;

And I need a way to convert this to a FILETIME

Thanks a bunch.


EDIT:

I’m not sure how I would fill a SYSTEMTIME structure, or even how to do it for a different time system. So I guess that is more my question.

I should have also mentioned that I only need accuracy of days. Hours and anything smaller aren’t really of concern to me.


EDIT2:

I must not have tried giving the SYSTEMTIME int values, because that seems to work. However, I am running into issues when I try to convert that systemtime to a filetime. It states “Error: no suitable converstion from “SYSTEMTIME” to “const SYSTEMTIME *” exists”. I’m not sure how to fix this, since if I define the systime variable as const SYSTEMTIME I can’t assign values to it.

here’s the relevant code, if it helps

SYSTEMTIME systime;
LPFILETIME ftime1;
LPFILETIME ftime2;
int dayint=6;
int monthint=12;
int yearint=1989;

systime.wDay = dayint;
systime.wMonth = monthint;
//and so on for year, hour, etc. 
SystemTimeToFileTime(systime,ftime1);     //This is where the aforementioned error occurs
GetFileTime(filename, NULL, NULL, ftime2);   //I'm also not sure about this line... feel free to critique it. I'm only interested in the last written time so I put NULL for the other times... When I check the values for this (in SYSTEMTIME) it only returns 52428, so I don't think this line is working correctly...
CompareFileTime(ftime1,ftime2);

Of course, the values for day, month, year aren’t hardcoded in the actual code.


EDIT3:

I have a bad handle….

I’m going to try to fix that….
Thanks for your help Ben Voigt
If I can’t get it, I guess I’ll be back

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:09:56+00:00Added an answer on June 8, 2026 at 12:09 am

    You can fill in a SYSTEMTIME structure and then call SystemTimeToFileTime

    You may want to use LocalFileTimeToFileTime afterwards, depending on whether you want to specify the hours in UTC or local time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a txt file that contains data which I need to input to
I have a file, serialized.txt, which contains a serialized array (created by doing serialize($array)).
in python , suppose i have file data.txt . which has 6 lines of
I have a .txt file which has about 500k entries, each separated by new
i have read file function which will read a txt file. after i read
I have a text file which contains the following: NUM,123 FRUIT DRINK FOOD,BACON CAR
I have a text file which contains matrix of N * M dimensions. For
I have a txt file with 16 lines of integers. Each line contains 5
I have a file that contains this: (Float,Float,Float)sometext (Float,Float,Float)sometext (Float,Float,Float)sometext ... ... and I
I have been trying to take chars from a txt file(in which the words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.