#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate including a date so that the date appears as a date Zembu Excel Worksheet Functions 2 January 6th 10 06:09 PM
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
Making a date go red, if date passes todays date. Jamie Excel Worksheet Functions 2 September 9th 08 02:14 PM
Report Date - Date Recv = Days Late, but how to rid completed date MS Questionnairess Excel Worksheet Functions 1 January 24th 07 11:05 PM
Date updates from worksheet to chart & changes date to a date series! Help!! Jayjg Charts and Charting in Excel 2 January 22nd 05 03:00 PM


All times are GMT +1. The time now is 07:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"