Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date bug
Hi all,
Not sure if this is me or a known problem, and is so if there is a work around. I am using a date function as follows: Format(Date$, "dd, mmm, yyyy") The month seems to be getting confused if the actual day is before the 12th. For example today is the 11th July (11/07) but it is being read as the 7th November (07/11). When I change my system date to 13th July it reads it perfectly. I have tried this on other peoples machines and the error is generated in the same way. Has anyone come across this and if so is there a solution to it ? Thanks, Mike. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date bug
?Format(Date$, "dd, mmm, yyyy")
11, Jul, 2003 Using Excel 97SR2 on Windows 98SE, I tried your expression in the Immediate window, and received the correct date. Maybe the regional settings (set through Control Panel) are different on my computer. HTH Paul -------------------------------------------------------------------------------------------------------------- Be advised to back up your WorkBook before attempting to make changes. -------------------------------------------------------------------------------------------------------------- On Fri, 11 Jul 2003 07:56:18 -0700, "Mike Berry" wrote: Format(Date$, "dd, mmm, yyyy") |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date bug
It isn't a bug - Excel VBA is US Centric in terms of most date handling.
If you are passing in a string that is dd/mm/yyyy, then you will get the results you describe with ambiguous dates (where it could be interpreted as mm/dd/yyyy) It is best to work with date serial numbers in VBA. that said, cdate is supposed to observe your regional settings, so try Format(cdate(Date$), "dd, mmm, yyyy") Regards, Tom Ogilvy "Mike Berry" wrote in message ... Hi all, Not sure if this is me or a known problem, and is so if there is a work around. I am using a date function as follows: Format(Date$, "dd, mmm, yyyy") The month seems to be getting confused if the actual day is before the 12th. For example today is the 11th July (11/07) but it is being read as the 7th November (07/11). When I change my system date to 13th July it reads it perfectly. I have tried this on other peoples machines and the error is generated in the same way. Has anyone come across this and if so is there a solution to it ? Thanks, Mike. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Concatenate including a date so that the date appears as a date | Excel Worksheet Functions | |||
date in Cell to change colors if the date is beyond today's date | Excel Discussion (Misc queries) | |||
Making a date go red, if date passes todays date. | Excel Worksheet Functions | |||
Report Date - Date Recv = Days Late, but how to rid completed date | Excel Worksheet Functions | |||
Date updates from worksheet to chart & changes date to a date series! Help!! | Charts and Charting in Excel |