Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 14th, 2006, 09:22 AM
Authorized User
 
Join Date: Aug 2006
Location: Banha, Kalubia, Egypt.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ADMystery Send a message via Yahoo to ADMystery
Default DateTime format quirks

Dear, All
  I have very strange problem, I have the short date format on the system (Windows XP) set to the following: d/MMM/yyyy, so today will be viewed as: 14/Sep/2006.
  but when I try to set the text in a textbox using the following statement: TextBox1.Text = Today.ToShortDateString()
it displayed: 9/14/2006.
  I don't need to say I try many formating variations, and I think there's something wrong on the system.
  please any suggestions will be highly appreciated.
  Thanks in advance :-)

Regards
Ahmad Mohsen
__________________
Ahmad Mohsen
 
Old September 14th, 2006, 10:37 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Have you tried:

Now.ToString("dd/MMM/yyyy")

"The one language all programmers understand is profanity."
 
Old September 17th, 2006, 04:34 AM
Authorized User
 
Join Date: Aug 2006
Location: Banha, Kalubia, Egypt.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ADMystery Send a message via Yahoo to ADMystery
Default

Dear, Sir (dparsons)
  You are from golden heaven :-), thank you so much..it did works.
but ispite it works, did it makes any sense that I set the System date settings to something and although I can't access this setting, is this a bug in Windows or Visual Studio or what..thanks in advance :-)

Regards
Ahmad Mohsen
 
Old September 17th, 2006, 12:37 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

What do you mean, access the DateTime format of your PC? Is your PC the web server?

--Stole this from a moderator

I will only tell you how to do it, not do it for you.

Unless, of course, you want to hire me to do work for you.
 
Old September 18th, 2006, 02:41 AM
Authorized User
 
Join Date: Aug 2006
Location: Banha, Kalubia, Egypt.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ADMystery Send a message via Yahoo to ADMystery
Default

Dear, Sir
  Forgive me, I don't get it :-)
as you must know, I speak English as my second language :-), so I can't decide are you angry with me or you just joke..of course I don't want to bother you by any means, I just need help.
anyway if I (unintentionally) annoy you, please accept my apologize.

Regards
Ahmad Mohsen
 
Old September 18th, 2006, 06:02 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No, Im not angry. You said:

but ispite it works, did it makes any sense that I set the System date settings to something and although I can't access this setting

What I meant was, you set the datetime to dd/mmm/yyyy on your PC, is your PC the webserver of your application?

Also you may want to read up on Localization in .NET, it had a great deal to do with how dates and such are displayed.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.

Unless, of course, you want to hire me to do work for you.




Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL DateTime format for Excel fmoon606 XSLT 8 May 23rd, 2008 05:35 PM
Convert DateTime Format dnyanubhamare C# 2005 2 February 25th, 2008 09:06 AM
hi! datetime format question.. xkorakidis JSP Basics 0 January 10th, 2008 06:17 AM
Datagrid / DateTime Format Setting tanakrita ASP.NET 1.0 and 1.1 Basics 2 May 17th, 2007 09:56 PM
Format datetime deb1980 ASP.NET 2.0 Basics 7 April 17th, 2007 12:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.