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

date conversion

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

Nov 19 '05 #1
2 4234
You can also use SomeDate.ToShortDateString( ) to get it in the format you
want (mm/dd/yyyy).
"Jeremy Cowles" <jeremy.cowles[nosp@m]asifl.com> wrote in message
news:7W*******************@twister.tampabay.rr.com ...
How do i convert this "Sun Jun 29 00:00:00 UTC 0800 2003"
to the normal date format (mm/dd/yyyy).
I don't know what the UTC 0800 is, so I haven't used it. I'm sure it has
something to do with time zone, but I will leave that up to you to figure
out (with Date.Parse you can specify the locale, which may be necessary

for the UTC thing):

Dim SomeDate As DateTime
Dim Tokens() As String
Dim StringDate As String

Tokens = "Sun Jun 29 00:00:00 UTC 0800 2003".Split(" ")
' 0 1 2 3------- 4-- 5--- 6---
StringDate = Tokens(1) & " "
StringDate &= Tokens(2) & " "
StringDate &= Tokens(6) & " "
StringDate &= Tokens(3) & " "

SomeDate = Date.Parse(DateString)
Console.WriteLine(somedate.ToString)
Console.Read()

~
Jeremy


Nov 19 '05 #2
Reb
:-)
-----Original Message-----
You can also use SomeDate.ToShortDateString( ) to get it in the format youwant (mm/dd/yyyy).
"Jeremy Cowles" <jeremy.cowles[nosp@m]asifl.com> wrote in messagenews:7W*******************@twister.tampabay.rr.co m...
> How do i convert this "Sun Jun 29 00:00:00 UTC 0800 2003" > to the normal date format (mm/dd/yyyy).
I don't know what the UTC 0800 is, so I haven't used it. I'm sure it has something to do with time zone, but I will leave that up to you to figure out (with Date.Parse you can specify the locale, which

may be necessaryfor
the UTC thing):

Dim SomeDate As DateTime
Dim Tokens() As String
Dim StringDate As String

Tokens = "Sun Jun 29 00:00:00 UTC 0800 2003".Split(" ")
' 0 1 2 3------- 4-- 5--- 6---
StringDate = Tokens(1) & " "
StringDate &= Tokens(2) & " "
StringDate &= Tokens(6) & " "
StringDate &= Tokens(3) & " "

SomeDate = Date.Parse(DateString)
Console.WriteLine(somedate.ToString)
Console.Read()

~
Jeremy


.

Nov 20 '05 #3

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: 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...
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
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
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,...
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.