473,385 Members | 1,888 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,385 software developers and data experts.

date conversion

Reb
Hi,

How do i convert this "Sun Jun 29 00:00:00 UTC 0800 2003"
to the normal date format (mm/dd/yyyy).

Thanks
Reb
Nov 15 '05 #1
3 2496
Reb <gb***@yahoo.com> wrote:
How do i convert this "Sun Jun 29 00:00:00 UTC 0800 2003"
to the normal date format (mm/dd/yyyy).


Use DateTime.Parse and one of the DateTime.ToString variants.

Look up "Date and Time Format Strings" in the MSDN for more
information.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #2
reb
hi Jon,

I tried to do this method. But looks like, it couldn't
recognise the format.

CultureInfo en = new CultureInfo("en-US");
String format = "MM/dd/yyyy hh:mm:sszzz";

// Converts the string back to a local DateTime and
displays it.
DateTime parsedBack =
DateTime.ParseExact(day,format,en.DateTimeFormat);

have u come across this before?
thx
Reb
-----Original Message-----
Reb <gb***@yahoo.com> wrote:
How do i convert this "Sun Jun 29 00:00:00 UTC 0800 2003" to the normal date format (mm/dd/yyyy).
Use DateTime.Parse and one of the DateTime.ToString

variants.
Look up "Date and Time Format Strings" in the MSDN for moreinformation.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
.

Nov 15 '05 #3
reb <gb***@yahoo.com> wrote:
I tried to do this method. But looks like, it couldn't
recognise the format.

CultureInfo en = new CultureInfo("en-US");
String format = "MM/dd/yyyy hh:mm:sszzz";

// Converts the string back to a local DateTime and
displays it.
DateTime parsedBack =
DateTime.ParseExact(day,format,en.DateTimeFormat);

have u come across this before?


Well, if you're trying to convert *from*
"Sun Jun 29 00:00:00 UTC 0800 2003" then the pattern you gave above
certainly won't work - you need to parse with one pattern and then
format with another.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet/
If replying to the group, please do not mail me too
Nov 15 '05 #4

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

Similar topics

3
by: praba kar | last post by:
Dear All, I have doubt regarding date string to time conversion function. In Python I cannot find flexible date string conversion function like php strtotime. I try to use following type...
1
by: Riley DeWiley | last post by:
I have an UPDATE query that is always setting 0 records. When I cut and paste the SQL into Access and use it, it fails in the same way unless I coerce the date fields to be '=now()', in which case...
1
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 set...
10
by: melissa.nava | last post by:
Here is my code: ***** Public Property DOB() As Date Get Try DOB = (msBirthMonth + "/" + msBirthDay + "/" + msBirthYear)
8
by: no_spam_for_gman | last post by:
Hi, Has anybody ever created a DB2 date function to convert a JDEdwards date to a db2 date? Example: September 28 is 106271 in JDEdwards.
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
10
by: =?Utf-8?B?TWlrZQ==?= | last post by:
I have a string variable containing a date formatted as YYYYMMDD For example - Dim x as string = "20070314" If I try to perform a type conversion as follows I get an error: Dim y as Date =...
1
by: vadala | last post by:
The requirement is to send start data and end date from java to UI (.net) for a functionality. We are setting the time in java (1.5) before handing it over to WebService (sending to UI ) in...
7
by: bruce.dodds | last post by:
Access seems to be handling a date string conversion inconsistently in an append query. The query converts a YYYYMM string into a date, using the following function: CDate(Right(,2) & "/1/" &...
2
by: RN1 | last post by:
A TextBox displays the current date (in dd/mm/yyyy format) & time when a user comes to a page (e.g. 15/10/2008 1:36:39 PM). To convert the date into international format so that the remote server...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
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 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.