Public Function nullToDate(ByVal val As Object) As DateTime
Return Convert.ToDateTime(val).to
End Function
Main Topics
Browse All TopicsHi,
This is the Function i am using for validating dates.
Public Function nullToDate(ByVal val As Object) As DateTime
Return Convert.ToDateTime(val)
End Function
Input string as follows: 2005-09-01T00:00:00.000000
Output:
a)Time zone : Central time #8/31/2005 11:00:00 PM#
b)Time zone : Eastern 9/1/2005
c)Time zone : Pacific time 8/31/2005 9:00:00 PM
The above function gives three different results in three different time zone for the given input string.
I want to write a function which gives just only the date for the above input and in different time zones.
your reply will be highly appreciated
Thanks,
Rithesh
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: aaronchanPosted on 2006-10-19 at 19:32:32ID: 17771208
You can force your return as String with mm/dd/yyyy format:
String("MM /dd/yyyy")
Public Function nullToDate(ByVal val As Object) As String
Return Convert.ToDateTime(val).To
End Function