Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 May 7th, 2005, 01:11 AM
Authorized User
 
Join Date: Aug 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default want to get short date

hi,
i am trying to use default value for the date in my form ,so i used:
textbox1.text=new date().date
but it shows it in this format 5/7/2005 11:20:00 A.M
i want it to be in this format: 5/7/2005
how can i do that?

 
Old May 7th, 2005, 03:38 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use the Date.ToShortDateString() the set to the date your system Short Dateformat.


 
Old May 7th, 2005, 11:02 PM
Authorized User
 
Join Date: Aug 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i tried this:
Dim MyDate As New DateTime
        MyDate = DateTime.Now
        TextBox1.Text = MyDate.ToShortDateString()
but still shows the long date time format?

 
Old May 8th, 2005, 01:24 AM
Authorized User
 
Join Date: Aug 2004
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

guess what was the problem,i need to debug the project to make it work....thanks alot for your help






Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Short cut mateenmohd Access 2 November 20th, 2007 05:30 AM
Converting short date to show mm/dd/yyyy crabjoe Access 4 March 7th, 2007 03:46 AM
Short format November date problem stratinblue Access ASP 1 November 26th, 2006 06:25 PM
how to write SQL ..short way pallavijyo SQL Language 3 December 10th, 2004 12:55 PM





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