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

How to convert user-defined custom format date string to date value

I write an application which can let user define own date format to input,
How to convert the date string to date value with end-user defined date
format?

Example, User Defined Date Format as "dd/MM/yyyy"

input as "01082003" convert to date value as, 01 Aug 2003

Example, User Defined Date Format as "yyyy,dd,MM"

input as "2004,03,30" convert to date value as, 30 Mar 2004

Example, User Defined Date Format as "MM dd yyyy"

input as "05 07 2005" convert to date value as, 07 May 2005

Assumption: I cannot change regional language settings, because some PCs may
also use by several users whom have use own faviour date format.
Nov 21 '05 #1
1 4566
Hi,

This should work:

~
DateTime.ParseExact(InputString, UserDefinedFormat,
Globalization.DateTimeFormatInfo.InvariantInfo)
~

HTH

Roman

Nov 21 '05 #2

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

Similar topics

1
by: Closer | last post by:
I am new to XML and XSL, could someone please help? I have my XML and XSL files and can view the XML file with the stylesheet in my browser. Everything is fine. What I want to do is to...
1
by: Logan X via .NET 247 | last post by:
It's official....Convert blows. I ran a number of tests converting a double to an integer usingboth Convert & CType. I *ASSUMED* that CType would piggy-back ontop of Convert, and that performance...
10
by: | last post by:
Hey I am calling Convert.ToDouble(someString); But this double can have to ways or representing doubles dependant on the locale, it can be 1.0 or 1,0 Is there a way to make...
22
by: ACaunter | last post by:
Hi, can someone please let me know if there is a way to convert a vb.net application to asp.net. Or if a vb.net application written in 3-tier could be run on the net??? Thanks! --...
2
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with...
3
by: csanjith | last post by:
Hi, i have a situaion where i need to convert the characters entered in an text field to upper case using C. The configuration id utf8 environment in which user can enter any character (single ,...
2
by: Jim Andersen | last post by:
I am going to build a webapp. Our users are not allowed to download certain files, so I need to show files in a directory (.doc, .ppt, ???) and the user can then convert them to PDF and download...
2
by: Kathi215 | last post by:
hi, i`m wowrking in project that accept user input from swtiches(on /off) which is binary and then i have to display that number in lcd via maicrocontroller.I'm using c interactive language.My...
23
by: Carl K | last post by:
I need to take the take the pdf output from reportlab and create a preview image for a web page. so png or something. I am sure ghostscript will be involved. I am guessing PIL or ImageMagic ? ...
5
by: WPW07 | last post by:
Hello, We have several complex applications developed in Access 2003 by various outside consultants. These applications link to a variety of Oracle tables and are used only for Access reports. ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.