473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Convert time to FILETIME

hi,

wel I have these vars:

double day,month,year,hour,minute,second,millisecond;

I want to convert this data to a filetime structure, I don't want of course to convert them manually


please help
May 21 '08 #1
2 4483
arnaudk
424 256MB
I think an int would be more appropriate... To copy those variables into a struct, you can use this syntax:
Expand|Select|Wrap|Line Numbers
  1. struct FileTime
  2. {
  3.     int day;
  4.     int hour;
  5.     // etc
  6.     FileTime(const int& d, const int& h);
  7. };
  8.  
  9. FileTime::FileTime(const int& d, const int& h)
  10.     : day(d), hour(h)
  11. { }
  12.  
  13. int main()
  14. {
  15.     int day = 1, hour = 23;
  16.     FileTime ft(day, hour);
  17.     cout << "The day is " << ft.day << endl;
  18. }
  19.  
In C, structs can't have constructors. In that case you could define a function which takes your variables and a (pointer to a) struct, and sets the struct variables accordingly.
May 21 '08 #2
Thx,

In fact, I don't want to define a new FileTime structure, I'd like to use the C predefined FILETIME structure.
May 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: | last post by:
First of all, I want to know if Cookie's expiration time and HTTP's header's last modified time are using the same format. Secondly, how do I format the time from a 10923023324324 kind of number...
4
by: tony | last post by:
Hello! I have this method ConvStdTimeToSec here that convert format hh:mm:ss into total number of seconds and return it. I just wonder if there exist a metod in the .NET framework that can be...
5
by: rob.zumwalt | last post by:
Hi All, I have written a wrapper around a C++ class to make it available to C#, built into a dll. This has gone just fine, but one of the methods in the C++ class takes a FILETIME pointer as an...
3
by: fmjoiner | last post by:
I have the code to convert a string into a int (the atoi function) but it only gives me the first number say if the time is 6:23:08 it only returns the number 6 but I need to change all of this to...
1
by: davelist | last post by:
I'm guessing there is an easy way to do this but I keep going around in circles in the documentation. I have a time stamp that looks like this (corresponding to UTC time): start_time =...
5
by: rouven | last post by:
Hi, i am trying to convert that time format '05:26:40 Jun 19, 2007 PDT' into mysql compatible format like YYYY-MM-DD HH:MM:SS. the code i tried was: from datetime import datetime from time...
0
by: dhanu sahu | last post by:
Hello friends, I am trying to convert datetime into integer, Ex- In dropdownlist 1- 9:30AM In dropdownlist 2- 6:PM I want total time as Thour=9:30AM-6:00PM,
0
by: Aandrew | last post by:
I need to be able to work out the UTC time given the local system time for any date in the year. I live in the UK and at the moment the time is GMT+1:00, however when we return to DST it will be...
1
by: dougancil | last post by:
I have the following sql query: SELECT .name, .Employeenumber, Convert (-(/1000)/60))/1440+1,"mm/dd/yy"as , FROM Employees INNER JOIN mOpInterval ON .Loginname1 = mOpInterval.Opname The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.