Results 1 to 3 of 3

Thread: compare modified timeon two file diff time zones

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2009
    Posts
    1

    compare modified timeon two file diff time zones

    Hi, I'm trying to compare modified time of two files which are in different time zones. I'm able to get the modified of both the files using GetFile and comparing them using DateDiff but since both the files are in different time zones result in incorrect. Getfile is not getting the time zone of the file.

    Is there any way to change the time zone of file1 to the time zone of file2. Here, time zone of file1 can be any timezone of 10 different site we have but i know the time zone of file2. Is there a way to do this with a vb script?


    Thanks in advance for the help!

  2. #2
    Frenzied Member
    Join Date
    Mar 2009
    Posts
    1,182

    Re: compare modified timeon two file diff time zones

    Couple of ways. Get the machine time (??? is that correct ???) and compare those or if you know the time zones and the difference between them, add that difference to the one that is lagging behind and then compare your dates.



    Good Luck
    Option Explicit should not be an Option!

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: compare modified timeon two file diff time zones

    file date times are stored as standard value (GMT), then displayed as local time

    see http://vbnet.mvps.org/index.html?cod...ledatetime.htm
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width