Format function bug or user error

S

Steve Long

Hello,
I'm encountering a bug, or user error, with the Format function and I'm
wondering if someone can either straighten me out or confirm the bug.
I'm passing in a Date to the Format function and a style:

Dim dte As Date = Date.Parse("8/19/2005 1:06:00 PM")
Dim s As String = "mm/dd/yyyy"

Console.WriteLine(Format(dte, s))

The Format function is returning:
06/19/2005

What is up with this?

Thanks in advance for any help
Steve
 
A

Armin Zingler

Steve Long said:
Hello,
I'm encountering a bug, or user error, with the Format function and
I'm wondering if someone can either straighten me out or confirm the
bug. I'm passing in a Date to the Format function and a style:

Dim dte As Date = Date.Parse("8/19/2005 1:06:00 PM")
Dim s As String = "mm/dd/yyyy"

Console.WriteLine(Format(dte, s))

The Format function is returning:
06/19/2005

What is up with this?

This is mm/dd/yyyy = minutes/day/year.

Use "MM" for month.


Armin
 
C

Cor Ligthert [MVP]

Steve,

Will you be so kind not to write "Bug" before you are absolute sure of it.

If everybody start from simple programs errors to tell that it can be a bug,
than Microsoft people will for sure ignore this newsgroups to look for bugs
what cannot be our goal.

Thanks in advance,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top