BBC BASIC for Windows
Programming >> Operating System >> FileTimeToSystemTime http://bb4w.conforums.com/index.cgi?board=os&action=display&num=1353329433 FileTimeToSystemTime
Post by Nanne on Nov 19th, 2012, 11:50am
Hi,
I create a file (with openout) at 13:22:00.
When I ask properties in Windows then the creationtime, accestime and modificationtime are 13:22:00.
That is correct.
When I asc the file time with FileTimeToSystemTime I get 12:22:00.
How is that possible? I't a difference from one hour.
Re: FileTimeToSystemTime
Post by admin on Nov 19th, 2012, 9:35pm
How is that possible? I't a difference from one hour.
Where do you live? The difference of one hour seems likely to be the difference between UTC and your local clock time (so it is, for example, what you would expect if you live in continental Europe rather than in the UK).
Using FileTimeToSystemTime will return the time in UTC; if you want it in local clock time you can use FileTimeToLocalFileTime before calling FileTimeToSystemTime.
Richard.
Re: FileTimeToSystemTime
Post by Nanne on Nov 19th, 2012, 10:08pm
Hi Richard,
Thank you for your reply. I live in the Netherlands. And indeed I spend this day with searching the internet for a solution. I have to convert the time to my local time. Yes I can do that with FiletTimeToLocalTime. The problem is that I don't know how the syntax is. I have searched the apiviewer from jon ripley but the link (even on you site) doesn't work. I hope that it will work tomorrow
Nanne
Re: FileTimeToSystemTime
Post by Nanne on Nov 19th, 2012, 10:54pm
Hi Richard,
With trial and error it works! (not the site but your hints)