Results 1 to 2 of 2
  1. #1
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    International Dates (xl97 and xl2000)

    In one cell I defined a date in "mm/dd/yyyy" format (it's not Excel formatted, it's just formatted as text as I edited the cell myself). This value is entered by the user not through code. In my code I use it to do comparisons on the current time. What do I need to do to make sure that this works when I send the workbook to a customer in China where the date format may be different? Is Excel smart enough to do the conversion between the contents of this cell and the date returned from the Now() function when it's run in another country? I couldn't find any function to return a UTC formatted date.
    Happy 50,000th
    Deb <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: International Dates (xl97 and xl2000)

    Excel keeps dates as the number of days since December 31, 1900, and the time as the fractional part of a day. Therefore, a date value of 1.0 is January 1, 1900 12:00 am, and a date value of 1.5 is January 1, 1900 12:00pm. If you enter something that looks like a date into a cell that is formatted as general or as a date, Excel will try to convert it into a date value. It will first try to interpret the date using the date format specified in the Windows Control Panel. But if the value entered is invalid for that format (ie you end up with month 30), then Excel will try other formats to see if it can come up something it can convert to date value. Once correctly converted to a date value, then comparisons are always valid no matter what display format is used in the particular country.

    If you are really entering the date as a text string, then Excel is going to leave it as a text string and is not going to convert to a date value. It is your responsibility to do any required conversions and comparisons.
    Legare Coleman

Posting Permissions

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