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 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
"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
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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:
...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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...
|
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,...
| |