473,320 Members | 2,122 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,320 software developers and data experts.

why is month format different ?

DateTime now = DateTime.Now; // { for Feb 9, 2006 }
string test = now.ToString("mm");
And I get 42 ?? what does this mean ?

For
string test = now.ToString("yyyydd");
test = "200609" ..
but
string test = now.ToString("yyyymmdd");
test = "20064209" .. I was expecting 20060209

--
Andrew
Feb 9 '06 #1
2 1245

"andrewcw" <an******@acw.com> wrote in message
news:57**********************************@microsof t.com...
DateTime now = DateTime.Now; // { for Feb 9, 2006 }
string test = now.ToString("mm");
And I get 42 ?? what does this mean ?

For
string test = now.ToString("yyyydd");
test = "200609" ..
but
string test = now.ToString("yyyymmdd");
test = "20064209" .. I was expecting 20060209

--
Andrew


You are getting the MINUTES portion of the date/time.

ToString expects mm for Minutes and MM for Month :)

Mythran

Feb 9 '06 #2
Thanks ! :)
--
Andrew
"Mythran" wrote:

"andrewcw" <an******@acw.com> wrote in message
news:57**********************************@microsof t.com...
DateTime now = DateTime.Now; // { for Feb 9, 2006 }
string test = now.ToString("mm");
And I get 42 ?? what does this mean ?

For
string test = now.ToString("yyyydd");
test = "200609" ..
but
string test = now.ToString("yyyymmdd");
test = "20064209" .. I was expecting 20060209

--
Andrew


You are getting the MINUTES portion of the date/time.

ToString expects mm for Minutes and MM for Month :)

Mythran

Feb 9 '06 #3

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

Similar topics

5
by: Dani | last post by:
Hi, I´m no superuser when it comes to MS Access. So I use MS Query to pull out info from an SQL database to Excel. I have a tabel containing different "titles" or "colums". One contains a date....
1
by: Finlay | last post by:
Hi Group I am designing a report that should show a meter reading for each month and the previous meter reading for the previous month. The months are text stored in a field tMonth. The...
13
by: jm | last post by:
I am trying to use datepart to get the real name of the month like "April" or "APR" not just "4." I could not find it in the documentation. Sorry. Thank you.
5
by: Ataru Morooka | last post by:
Hi, my table has to have a column with the months names (january, february...). When I order it by month it is ordered alphabetically and that's not what I need. Reading this ng I found someone...
5
by: hunt4grouse | last post by:
I'm looking for C code that will give me the last day of the month. Input - any day that I pass in as a variable.... input = 20050201 Output - calculate and format with slashes.... output =...
34
by: prosoft | last post by:
When I use Dim myDTFI As DateTimeFormatInfo = New CultureInfo("he-IL", True).DateTimeFormat Dim strhmon1 As String = (myDTFI.GetMonthName(hmon1)) MsgBox(strhmon1) I get the local name of the...
15
by: Jozef Jarosciak | last post by:
I need the function to tell me how many minutes past so far this month.
2
by: troddy | last post by:
I am using the DatePart funtion in a query to extract the day, month and year in separate fields in a query. The function works fine but I am only getting a number for the month even if the field...
22
by: Stan | last post by:
I am working with Access 2003 on a computer running XP. I am new at using Access. I have a Db with a date field stored as mm/dd/yyyy. I need a Query that will prompt for the month, ie. 6 for...
2
by: DavidOwens | last post by:
SELECT DISTINCTROW Format(PERIOD.START_DT,"mmmm yyyy") AS MonthYear, SALES.PERIOD_ID, Sum(SALES.SALES) AS SumOfSALES, Sum(SALES.SALES_UNITS) AS SumOfSALES_UNITS, Sum(SALES.SALES_VALUE) AS...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.