Results 1 to 3 of 3

Thread: Comparing two dates

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Liverpool, UK
    Posts
    64

    Question

    Can anyone think of a way to compare two dates that may be in a different format ? For example, I wan't to check that someone has the correct version of a file on their pc: I know that the date on the file should be 20/10/2000, when I use vb to return the date from the local file it returns it in the short date format on the pc, which may be different i.e. 10/20/2000. Although those dates are the same, they are represented differently, so how can I compare the two, or make them both the same format ?????

  2. #2
    Guest
    Use the Format function to convert dates into a specified format.

  3. #3
    Lively Member
    Join Date
    Aug 2000
    Posts
    125
    your system is set up either to recognize the US month first notation or the UK notation where everything is backwards

    You can directly compare Dates declared like:
    dim d as Date

    however if you want to read in a date that is backward on your system with the CDate function then you must know that it is backward and parse (and rearrange it) yourself

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