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

strange date-time format

Hello...

I have the following problem. I have date in ddMMyyHHmmss format.
Is there some Parse(String format) method, because i cannot find goot
parameters for DateTime.Parse(....)?

--
pozdwawiam,
Paweł Janik
Nov 15 '05 #1
2 5420
Pawel Janik <ja***@gazeta.pl> wrote:
I have the following problem. I have date in ddMMyyHHmmss format.
Is there some Parse(String format) method, because i cannot find goot
parameters for DateTime.Parse(....)?


I prefer ParseExact to Parse for this kind of thing - you need
something like:

DateTime x = DateTime.ParseExact
(value, "ddMMyyyy", CultureInfo.InvariantCulture.DateTimeFormat);

Note that which CultureInfo you wish to use will depend on exactly
where you're getting the data from. (Admittedly with the patterns we're
talking about it's unlikely to make much difference as far as I can
see, but with other patterns it would.)

--
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
Jon Skeet [C# MVP] wrote:
Pawel Janik <ja***@gazeta.pl> wrote:
I have the following problem. I have date in ddMMyyHHmmss format.
Is there some Parse(String format) method, because i cannot find goot
parameters for DateTime.Parse(....)?


I prefer ParseExact to Parse for this kind of thing - you need
something like:

DateTime x = DateTime.ParseExact
(value, "ddMMyyyy", CultureInfo.InvariantCulture.DateTimeFormat);

Note that which CultureInfo you wish to use will depend on exactly
where you're getting the data from. (Admittedly with the patterns
we're talking about it's unlikely to make much difference as far as I
can see, but with other patterns it would.)


Thanks a lot. It works perfectly!

Pawel Janik
Nov 15 '05 #3

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

Similar topics

6
by: WindAndWaves | last post by:
Hi Gurus The page below has a strange error. It seems to be working very well, just when you enter 8 or 9 for day, month or year then you get an error. I really have no idea where that is...
4
by: Andrei Ivanov | last post by:
Hello, I have 2 tables: CREATE TABLE products ( id SERIAL PRIMARY KEY, name VARCHAR(255) NOT NULL ); CREATE TABLE products_daily_compacted_views ( product ...
3
by: Jim Irvine | last post by:
I have a small database made up of 2 tables. I have a report that is driven from a query. On the report are a couple of fields linked to memo boxes in the table. Everytime I run the report I get...
10
by: Trapulo | last post by:
Why Now.Date.Subtract(New Date(2000, 1, 1)).Days returns 731529?? It is a too big value a think! I aspect something as 1030-1100....
1
by: Maileen | last post by:
Hi, I finished my application butonce again i have some strange behavior with XML/text functions... for example, here below is a function which worked perfectly till now and now generate an...
14
by: dananrg | last post by:
Been using the ODBC module for Python 2.1 (Win32) and had another question. When I return data from date columns, it's in a strange object form, e.g. <something or other> (don't have the output in...
2
by: peter | last post by:
Hi, I have very strange situation but first description ;) I have: 1) project in VB.NET, in this f.e. 1 function: Public Function Login(ByVal UserName As String, ByVal UserPassword As...
1
by: Victor | last post by:
Hi guys, I have a very strange problem with scriptmanager here. I want to load a js (which is embed in the project) but everytime i try to load that, it gives me error like Specified argument was...
3
by: Reg143 | last post by:
Hi all, The code below loops from a starting date, incrementing the date and displaying date and day-of-week. Everything is fine until 2007-11-04 is reached. Any help would be appreciated. ...
0
by: charmeda103 | last post by:
when i run my program it runs with no erorrs but the output screen is giving me strange results here is whats its giving me: CONFERENCE OVERALL RANK TEAM W-L % WINS MARGIN W-L ...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...

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.