473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Format function bug or user error

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
Nov 21 '05 #1
4 1119
mm = minutes, MM=month
"Steve Long" <St**********@NoSpam.com> wrote in message
news:Ox**************@TK2MSFTNGP10.phx.gbl...
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

Nov 21 '05 #2
"Steve Long" <St**********@NoSpam.com> schrieb
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
Nov 21 '05 #3
Silly me. Thanks guys.

Steve

"Steve Long" <St**********@NoSpam.com> wrote in message
news:Ox**************@TK2MSFTNGP10.phx.gbl...
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

Nov 21 '05 #4
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
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew | last post by:
I have 2 XSL stylesheets which both draw on data from Team Services. The same code is included in each stylesheet to format the date using VBScript: ================= <msxsl:script...
6
by: WindAndWaves | last post by:
Hi Gurus In my quest in putting my first javascript together, I am now trying to conquer something that seems trivial, but has taken me hours. I would like to format a field in a form once the...
2
by: Tatiana Zadiraka | last post by:
I use DB2 8.1 with FixPack 5. In command line for sql I get all DATE columns only in MM-DD-YYYY format. Of course, DATE('20-12-2003') gives me an error SQL0181N The string representation of a...
1
by: mahnovetsky | last post by:
Does anybody know of a way to set the format property for a date field in VBA?? I need to set the property to medium so I can display display aussie dates on a graph.. Here is what Im doing: ...
7
by: RCS | last post by:
Okay, a rather 'interesting' situation has arisen at a place I work: I need to convert a database from Access to something that can be used over the web. I am currently maintaining and...
2
by: DD | last post by:
I have a UnionQry that is run from StatementsI and StatementP. the Due and Paid colunms are currency and show the $ however when i union the two the currency format has gone. Any help please...
1
by: bidllc | last post by:
I'm working on a minor bug from an open source bug tracking system (bugtracket.net). It's a great app, but I don't want to bother the creator any more than I have to, so I thought I'd pose the...
12
by: Rob Meade | last post by:
Hi all, Ok - I've come from a 1.1 background - and previously I've never had any problem with doing this: Response.Write (Session("MyDate").ToString("dd/MM/yyyy")) So, I might get this for...
7
by: iporter | last post by:
I use the code below to authorise the download of certain files. Thus, instead of linking to the file in a wwwroot directory, I link to this code with the filename as a parameter, and the script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.