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

DateTime function

First of all thanks all guys for your time to look at my problem.

The problem I am having is datetime function.
Basically, I would like to have a datetime function that works machine
independently.
So regardless of the format of datetime string(ie,
d/MM/yyyy,dd/MM/yyyy,yyyy/MM/dd), this function takes this string and
convert it to the correct datetime that my server could recognise as
datetime(which is d/MM/yyyy).

Thanks again,


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
1 1220
"TaeHo Yoo" <yo******@yahoo.com> wrote
The problem I am having is datetime function.
Basically, I would like to have a datetime function that works machine independently.
So regardless of the format of datetime string(ie,
d/MM/yyyy,dd/MM/yyyy,yyyy/MM/dd), this function takes this string and
convert it to the correct datetime that my server could recognise as
datetime(which is d/MM/yyyy).


TaeHo,
Use the DateTime.Parse method. It contains several overload methods which allow you
to specify the CultureInfo, so it knows how to parse different culture formats.

For more information, see the sample code VB.NET code at the bottom of the following page
http://msdn.microsoft.com/library/en...parsetopic.asp

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com


Nov 17 '05 #2

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

Similar topics

4
by: Rob Conner | last post by:
So this is simple, why can't I run the following code? I've tried many variances of this, but simply cannot inherit from datetime or datetime.datetime. I get this on line 3. TypeError: function...
15
by: Fritz Switzer | last post by:
I'd like to have a string assigned the value of a DateTime.AddMinutes(amount) so that the string is formatted in "HH:MM" format. For example: DateTime.Now.AddMinutes(30) returns "00:30" ...
3
by: Christopher Crooker | last post by:
We had a function with the signature: Function(Object *, DateTime, DateTime, EnumType) and then changed the class some and there was a 4 parameter function with the signature: ...
11
by: Cor Ligthert | last post by:
Hello everybody, Jay and Herfried are telling me every time when I use CDate that using the datetime.parseexact is always the best way to do String to datetime conversions. They don't tell why...
1
by: cinsky | last post by:
Hi, I got confused when I learned the function datetime.today(). So far I learned, unless an instance is created, it is not possible to call the class method. For example: class Foo: def...
7
by: =?Utf-8?B?UGVuIEp1YW4=?= | last post by:
How to define databinding for 'datetime' data type ? ( Xxx = '<%# Bind("Datetime") %>' ) Thank you. Pen
0
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any...
5
by: indika | last post by:
Hi, I'm a newbie to python but have some experience in programming. I came across this requirement of using datetime.date objects associated with some another object. eg. a dictionary containing...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.