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

Date Convert

In my C# Webapplication..
I enter the date in a textbox using popup Calender in the format
MM/dd/yyyy..
when i retrieve date from Sql server for updating using datarow to fill the
textbox the date format dd/MM/yyyy hh-mm-ss i want to convert it back to the
original format & ommit the time..

How can i convert this back so i void the exception if user didn't change
date in the update form??
Any help plz

Nov 19 '05 #1
2 1418
Hi,

You can convert a DateTime to string as desired using DateTime.ToString() ,
like this:
DateTime.Today.ToString( "dd/MM/yy", DateTimeFormatInfo.InvariantInfo );

In a similar way you can use DateTime.Parse or DateTime.ParseExact
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Islam Elkhayat" <is******@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
In my C# Webapplication..
I enter the date in a textbox using popup Calender in the format
MM/dd/yyyy..
when i retrieve date from Sql server for updating using datarow to fill
the textbox the date format dd/MM/yyyy hh-mm-ss i want to convert it back
to the original format & ommit the time..

How can i convert this back so i void the exception if user didn't change
date in the update form??
Any help plz

Nov 19 '05 #2
check here

http://msdn.microsoft.com/library/de.../en-us/cpref/h
tml/frlrfsystemdatetimeclasstostringtopic.asp

--
rajagopal

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #3

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

Similar topics

15
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
4
by: Russell | last post by:
I'm having a fit with a query for a range of dates. The dates are being returned from a view. The table/field that they are being selected from stores them as varchar and that same field also...
4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
1
by: Jama | last post by:
I have dates stored as 20040904(yyyymmdd numeric) in DB2 database. I want to get the difference between two dates. I also have the same database in SQL Server database and I am using the following...
1
by: Scott Berry | last post by:
Hi, I have an ADP file that stores dates in a datetime field type and I want to query the table for all records for a single date (ie. ignore the time). I want it to automatically return all...
2
by: Franck | last post by:
Hi, 'm gettin mad about date conversion. Here is the point. Got and add-in for Excel which call functions from a web service (on a remote server) The remote server has regional settings...
8
by: John Wildes | last post by:
Hello all I'm going to try and be brief with my question, please tell me if I have the wrong group. We are querying transaction data from a DB3 database application. The dates are stored as...
4
by: blini | last post by:
Helo.... How I can convert string "26/03/2006 15:51" for a date? I need to convert and to compare if "09/06/2006 14:20" is lesser or equal that the current date. Everything in Javascript.
13
by: Jim Armstrong | last post by:
Hi all - This problem has been driving me crazy, and I'm hoping the answer is something stupid I am neglecting to see.... The procedure posted below is part of an Access/SQL database I have...
9
by: Alok yadav | last post by:
i am using a webservice in which a method is serach. i use this method which accept a argument of date type in dd/MM/yyyy formate. i have a textbox which accept the date from the user, when i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.