|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
FileSystemObject vs System.IO.FileHi all,
I am slowly re-writing old VB6 code to VB.NET. I have 1 problem. I was using FileSystemObject to return the modified timestamp of a file, all worked well. When I use System.IO.File.GetLastWriteTime(MyFile).ToShortTimeString the time is 1 hour behind that of the file. For example, I look in Windows Explorer and see that the time stamp is 11:24. System.IO.File.GetLastWriteTime(MyFile).ToShortTimeString reports it at 10:24 though. The system clock is set correctly and also if i test it with FSO, it reports the same time as Windows Explorer. What is wrong??? Thanks, Steve Hi,
Probably you want to use the fileinfoclass http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiofileinfomemberstopic.asp I hope this helps, Cor I can see your point because I wrote a simple function & that displays the
time one hour earlier than explorer too. Take a look below: Private Function GetFileLastWriteTime(ByVal sFile As String) As DateTime Dim fiFile As New IO.FileInfo(sFile) Dim dtFile As Date = fiFile.LastWriteTime Return dtFile.ToShortTimeString End Function Crouchie1998 wrote:
> I can see your point because I wrote a simple function & that exactly. I have not yet tried it with the FileInfo class as Cordisplays the > time one hour earlier than explorer too. Take a look below: > > Private Function GetFileLastWriteTime(ByVal sFile As String) As DateTime > Dim fiFile As New IO.FileInfo(sFile) > Dim dtFile As Date = fiFile.LastWriteTime > Return dtFile.ToShortTimeString > End Function suggests, although I expect it to be the same because of the specifications on MSDN. 1 question crouchie, what are your Regional Settings? i.e. Which time zone are you set to? I am set to +1 and of course the clocks went forward this weekend! I would be curious to know if this happens to people with GMT or a different time zone to me. I can only think that it is a bug as FSO reports it just fine. Of course, the problem with FSO is that it isn't .NET! Any help appreciated. Hi,
GMT is always the same, even in Greenwich where British Summer Time is used. Cor Clocks in the US spring forward next Sunday. Are there countries where the
shift to Daylight Savings Time has occurred already? Mike Ober. <google_grou***@hotmail.com> wrote in message Show quoteHide quote news:1112026659.492020.109670@z14g2000cwz.googlegroups.com... > > Crouchie1998 wrote: > > I can see your point because I wrote a simple function & that > displays the > > time one hour earlier than explorer too. Take a look below: > > > > Private Function GetFileLastWriteTime(ByVal sFile As String) As > DateTime > > Dim fiFile As New IO.FileInfo(sFile) > > Dim dtFile As Date = fiFile.LastWriteTime > > Return dtFile.ToShortTimeString > > End Function > > exactly. I have not yet tried it with the FileInfo class as Cor > suggests, although I expect it to be the same because of the > specifications on MSDN. 1 question crouchie, what are your Regional > Settings? i.e. Which time zone are you set to? I am set to +1 and of > course the clocks went forward this weekend! I would be curious to > know if this happens to people with GMT or a different time zone to me. > I can only think that it is a bug as FSO reports it just fine. Of > course, the problem with FSO is that it isn't .NET! > > Any help appreciated. > I suspect this problem will clear starting April 2nd. If so, this appears
to be a bug in the regional settings of the .NET runtime and should be reported to the Visual Studio team. - V 2.0 is in beta so now's the time to get this fixed. Mike Ober. Show quoteHide quote "Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message news:%23NVTF2CNFHA.3788@tk2msftngp13.phx.gbl... > Michael, > > EU on Easter Saterday/Sunday > > Cor > > I suspected that is was a bug. So roll on tomorrow!
-- Show quoteHide quoteDaniel MCSE, MCP+I, MCP in Windows 2000/NT -------------------------------------- remove the 2nd madrid from my mail address to contact me. "Michael D. Ober" <ober***@.alum.mit.edu.nospam> wrote in message news:BE23e.1491$EE2.1004@newsread2.news.pas.earthlink.net... >I suspect this problem will clear starting April 2nd. If so, this appears > to be a bug in the regional settings of the .NET runtime and should be > reported to the Visual Studio team. - V 2.0 is in beta so now's the time > to > get this fixed. > > Mike Ober. > > "Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message > news:%23NVTF2CNFHA.3788@tk2msftngp13.phx.gbl... >> Michael, >> >> EU on Easter Saterday/Sunday >> >> Cor >> >> > > > Clocks already changed here in Madrid and it causes the same problem for me!
Is it the same for people in the UK anyone? -- Show quoteHide quoteDaniel MCSE, MCP+I, MCP in Windows 2000/NT -------------------------------------- remove the 2nd madrid from my mail address to contact me. "Michael D. Ober" <ober***@.alum.mit.edu.nospam> wrote in message news:l132e.6811$H06.6787@newsread3.news.pas.earthlink.net... > Clocks in the US spring forward next Sunday. Are there countries where > the > shift to Daylight Savings Time has occurred already? > > Mike Ober. > > <google_grou***@hotmail.com> wrote in message > news:1112026659.492020.109670@z14g2000cwz.googlegroups.com... >> >> Crouchie1998 wrote: >> > I can see your point because I wrote a simple function & that >> displays the >> > time one hour earlier than explorer too. Take a look below: >> > >> > Private Function GetFileLastWriteTime(ByVal sFile As String) As >> DateTime >> > Dim fiFile As New IO.FileInfo(sFile) >> > Dim dtFile As Date = fiFile.LastWriteTime >> > Return dtFile.ToShortTimeString >> > End Function >> >> exactly. I have not yet tried it with the FileInfo class as Cor >> suggests, although I expect it to be the same because of the >> specifications on MSDN. 1 question crouchie, what are your Regional >> Settings? i.e. Which time zone are you set to? I am set to +1 and of >> course the clocks went forward this weekend! I would be curious to >> know if this happens to people with GMT or a different time zone to me. >> I can only think that it is a bug as FSO reports it just fine. Of >> course, the problem with FSO is that it isn't .NET! >> >> Any help appreciated. >> > > > Daniel,
I was always thinking that Spain was a part of the EU, is that shortly ago changed? However to show you the summer times etc in the countries from the EU were the UK is as well a part from. http://wwp.greenwichmeantime.com/time-zone/rules/eu.htm Cor ???? I never said it was not Cor. I merely stated that I have the same
problem and I live in Spain AND the clocks here have already gone forward. Sarcasm is the lowest form of wit. -- Show quoteHide quoteDaniel MCSE, MCP+I, MCP in Windows 2000/NT -------------------------------------- remove the 2nd madrid from my mail address to contact me. "Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message news:eCuD0VHNFHA.3704@TK2MSFTNGP12.phx.gbl... > Daniel, > > I was always thinking that Spain was a part of the EU, is that shortly ago > changed? > > However to show you the summer times etc in the countries from the EU were > the UK is as well a part from. > > http://wwp.greenwichmeantime.com/time-zone/rules/eu.htm > > Cor > > Daniel,
This is a developers newsgroup. I wrote 5 hours before you, that the time was changed in the EU. Your message looked therefore for me as this kind of code If Country = EU then 'time is changed ElseIf State = Spain 'time is changed End if And that kind of code I don't like, because it is only confusing pretending if Spain is not a state of the EU and when it is absolute useless. Therefore my message. Cor Cor. When replying to Michael D. Ober I provided more information that just
a region of the world that the clocks have already changed. So, instead of just saying "EU on Easter Saterday/Sunday" I stated where I live, the fact that the clocks have changed and importantly, the fact that I have the same problem with this. Far more helpful than your post. So please, if you want to start a petty argument or flame war, please do it with somebody else. It is a shame when people use these forums to irritate people. If you wish to discuss this further, you can email me directly rather than wasting people precious bandwidth by posting here. Or maybe you can read it better this way: If DiscussSubjectFurther = True Then EmailMeDirect = True Else Exit Thread End IF p.s. 5 hours is not that great a time difference when posting to groups. Although I am using a newsreader to post, sometimes I use Google and that can take many more hours than 5 for new messages to appear, often meaning that 2 different people can reply to the same post without knowing about it. -- Show quoteHide quoteDaniel MCSE, MCP+I, MCP in Windows 2000/NT -------------------------------------- remove the 2nd madrid from my mail address to contact me. "Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message news:%23nQ7nccNFHA.2604@TK2MSFTNGP10.phx.gbl... > Daniel, > > This is a developers newsgroup. I wrote 5 hours before you, that the time > was changed in the EU. > > Your message looked therefore for me as this kind of code > > If Country = EU then > 'time is changed > ElseIf > State = Spain > 'time is changed > End if > > And that kind of code I don't like, because it is only confusing > pretending if Spain is not a state of the EU and when it is absolute > useless. > > Therefore my message. > > Cor > Daniel,
I did not noticed that it where flames from you to irritate me, glad that you made me attend on it. Therefore my last message. Cor Your post makes no sense.
-- Show quoteHide quoteDaniel MCSE, MCP+I, MCP in Windows 2000/NT -------------------------------------- remove the 2nd madrid from my mail address to contact me. "Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message news:eumdbedNFHA.576@TK2MSFTNGP12.phx.gbl... > Daniel, > > I did not noticed that it where flames from you to irritate me, glad that > you made me attend on it. > > Therefore my last message. > > Cor >
Only Numeric Values in the textbox
Query database in VB.NET Create ListView columns dynamically from XML record locking with DBF (visual basic) table in ADO OLEDB in VB.NET Set Desktop Setup problem replace oddity need ideas - how to determine when another machine has persisted a file How to have embeded pictures in a project vb.net exe file |
|||||||||||||||||||||||