It is currently Wed Jun 19, 2013 9:38 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [461b1] SetFileDate questions?
PostPosted: Mon Mar 19, 2012 4:22 am 
Online
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 1411
Location: Boston, MA
Code:
Define.i DateMod
Define FilePathName$ = "c:\TRY_PB_SetFileDate.txt"
If CreateFile(0, FilePathName$)
  CloseFile(0)
  DateMod = ParseDate("%yy-%mm-%dd %hh:%ii:%ss", "12-01-02 00:01:01")
  Debug FormatDate("%yy-%mm-%dd %hh:%ii:%ss", DateMod)
  Debug SetFileDate(FilePathName$, #PB_Date_Created, DateMod)
  Debug SetFileDate(FilePathName$, #PB_Date_Modified, DateMod)
  Debug SetFileDate(FilePathName$, #PB_Date_Accessed, DateMod)
  Debug FormatDate("%yy-%mm-%dd %hh:%ii:%ss", GetFileDate(FilePathName$, #PB_Date_Modified))
EndIf

Debug Output wrote:
12-01-02 00:01:01
1
1
1
12-01-02 00:01:01

But I get Sunday, ‎January ‎01, ‎2012, ‏‎11:01:01 PM for Windows 7 properties of the file.

Should I use the Windows API or am I doing something wrong with regard to daylight savings time or is this a bug?

I know DirectoryEntryDate(iDir,#PB_Date_Modified) retrieves a valid and accurate Date since I stored it and wrote it back to a file in a different location using SetFileDate() and they were identical.

_________________
To understand recursion, you must first understand recursion. ~ unknown
I never make stupid mistakes. Only very, very clever ones. ~ John Peel


Top
 Profile  
 
 Post subject: Re: [461b1] SetFileDate questions?
PostPosted: Wed Apr 11, 2012 10:38 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Sep 23, 2008 11:38 pm
Posts: 702
Location: Belgium (& Luxembourg)
Skywalk,

I have the same result as you, Windows Explorer shows one hour earlier than your ParseDate().
As I am living in a time zone GMT+1 (or UTC+1), I thought first that Windows showed the UTC time (Universal Time Coordinated).
BUT... I changed the time zone to UTC+9 (=Japan), and the Explorer was showing the same time as the ParseDate().

I am also puzzled.....

_________________
- Future conversation forecasting not yet implemented.
- If the future had copied a program from now, they would have called it version -1.


Top
 Profile  
 
 Post subject: Re: [461b1] SetFileDate questions?
PostPosted: Fri Apr 13, 2012 12:02 am 
Offline
Enthusiast
Enthusiast

Joined: Mon May 14, 2007 2:13 am
Posts: 736
Location: Darling River
Perhaps it has something to do with day light saving setting, just a thought. :idea:

_________________
PureBasic Rocks! Even More! And More!
PureBasic 5, Now We're Really Rockin!


Top
 Profile  
 
 Post subject: Re: [461b1] SetFileDate questions?
PostPosted: Fri Apr 13, 2012 7:14 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 22, 2010 1:50 am
Posts: 475
Location: Bradenton, FL
electrochrisso wrote:
Perhaps it has something to do with day light saving setting, just a thought. :idea:

When I use a date and time that is inside the day light savings time period, as we are now, 3/11/2012, 03:00:00, it works correctly.

If I use a date and time just prior to 3/11/2012, 02:00:00, I lose an hour. This must be for daylight saving, and appears correct?

Since technically 3/11/2012, 02:30:00 does not exist, my system still removes an hour, though right-clicking on the file seems to show some screwy settings when you try to use this invalid time.


Top
 Profile  
 
 Post subject: Re: [461b1] SetFileDate questions?
PostPosted: Tue Apr 17, 2012 12:28 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Sep 23, 2008 11:38 pm
Posts: 702
Location: Belgium (& Luxembourg)
Not sure, but this topic can probably guide you to find the reason...
http://www.purebasic.fr/english/viewtopic.php?f=12&t=40809&p=338385&hilit=timezoneinformation#p338385

_________________
- Future conversation forecasting not yet implemented.
- If the future had copied a program from now, they would have called it version -1.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Exabot [Bot], User_Russian and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye