Futuristic GETSTAMP

rocatis
Member Posts: 163
f:file
d:date
t:time
f.CREATE('c:\test');
f.close;
getstamp('c:\test',d,t);
MESSAGE('%1\%2',
format(CURRENTDATETIME,0,'<Hours,2>:<Minutes,2>:<Seconds,2>:<Thousands,3>'),
format(CREATEDATETIME(d,t),0,'<Hours,2>:<Minutes,2>:<Seconds,2>:<Thousands,3>'));
If you run this you will find that the file is always created in the future... Okay, so it's only between half a second and two seconds, but it's in the future nonetheless.
Any brilliant minds out there that can explain this?
d:date
t:time
f.CREATE('c:\test');
f.close;
getstamp('c:\test',d,t);
MESSAGE('%1\%2',
format(CURRENTDATETIME,0,'<Hours,2>:<Minutes,2>:<Seconds,2>:<Thousands,3>'),
format(CREATEDATETIME(d,t),0,'<Hours,2>:<Minutes,2>:<Seconds,2>:<Thousands,3>'));
If you run this you will find that the file is always created in the future... Okay, so it's only between half a second and two seconds, but it's in the future nonetheless.
Any brilliant minds out there that can explain this?
Brian Rocatis
Senior NAV Developer
Elbek & Vejrup
Senior NAV Developer
Elbek & Vejrup
0
Comments
-
I ran it in 2013 and the results are
09:38:23:283
09:38:23:279
Looks fine to me on rtc.0 -
ara3n wrote:I ran it in 2013 and the results are
09:38:23:283
09:38:23:279
Looks fine to me on rtc.
I'm getting too old for this shit :roll:Brian Rocatis
Senior NAV Developer
Elbek & Vejrup0 -
It's a good reason to upgrade.0
-
I was being sarcastic. You can submit contact MS for a fix.0
-
What is the granularity of whatever timestamp GETSTAMP returns on the filesystem you are writing to / reading from?
(And to be pedantic: the date returned is undefined because you never wrote anything to the file:GETSTAMP Function (File)
Use this function to find out exactly when a file was last written to (return a timestamp).
On NTFS with NAV 2009 R2 Classic I get17:12:35:227
17:12:36:0000 -
vaprog wrote:What is the granularity of whatever timestamp GETSTAMP returns on the filesystem you are writing to / reading from?
Use GETSTAMP on any file on your system and you will get a wrong time (compared to what the file properties window will tell you in Explorer). It's just a bit hard to see because the time stamp in Explorer is only shown down to the second.vaprog wrote:And to be pedantic: the date returned is undefined because you never wrote anything to the file:vaprog wrote:On NTFS with NAV 2009 R2 Classic I get17:12:35:227
17:12:36:000
17:50:34:021
17:50:36:000
17:50:56:816
17:50:58:000
It's never more than 2 seconds though :-kBrian Rocatis
Senior NAV Developer
Elbek & Vejrup0 -
rocatis wrote:vaprog wrote:What is the granularity of whatever timestamp GETSTAMP returns on the filesystem you are writing to / reading from?rocatis wrote:vaprog wrote:And to be pedantic: the date returned is undefined because you never wrote anything to the file:Use this function to find out exactly when a file was last written to (return a timestamp).
And I said I was being pedantic - to the documentation, that is. The statement was meant to make you think about your expectation in the light of what is promised to you (i.e. documented) concerning this function. Note: nothing is said about the precision of the returned timestamp.rocatis wrote:The file is still modified in the future.rocatis wrote:Did you run the test multiple times? And if so, was the displacement the same every time? I could sort of accept it if the time stamp was just rounded up to the nearest second, but that's not the case either I just did a couple of tests:0 -
vaprog wrote:With granularity I meant the precision with which the date is recorded in the file system. See File Times on msdn for some more info.
Interestingly enough, the "File Times" link you provided says "For example, the resolution of create time on FAT is 10 milliseconds, while write time has a resolution of 2 seconds". But we're not using FAT, and if you view the properties of a file in Explorer the granularity is (at least) 1 second.
Also, doing the test using NAV 2013 tells us that the granularity here is 1/1000s.
My guess is that the GETSTAMP function was rewritten/updated in NAV 2013 to show the actual date/time stamp of the file whereas the function in earlier versions were written to adhere to the way FAT works. This would make sense insofar as NAV was born from FAT - so to speak.
Even so I still think it's weird that the time is rounded up and not down.Use this function to find out exactly when a file was last written to (return a timestamp).(emphasis mine)
I think we're in agreement.Brian Rocatis
Senior NAV Developer
Elbek & Vejrup0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions