Solved

how do i convert a date from the format mmddyyhhmiss to yyyymmdd-hh24miss-very urgent

Posted on 2007-03-18
6
290 Views
Last Modified: 2008-02-01
how do i convert a date from the format mmddyyhhmiss to yyyymmdd-hh24miss-very urgent
0
Comment
Question by:amukta
  • 3
  • 3
6 Comments
 
LVL 16

Accepted Solution

by:
AlexNek earned 500 total points
ID: 18744735
Parse string to DateTime first and then format how you need
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 18744789
Something like
//mmddyyhhmin
string dateString = "031820070915";
IFormatProvider culture = new CultureInfo("en-US", true);
DateTime dt = DateTime.ParseExact(dateString, "MMddyyhhmm", culture);
Console.WriteLine(dt);

//yyyymmdd-hh24min
Console.WriteLine(dt.ToString("yyyMMdd-HHmm"));

0
 

Author Comment

by:amukta
ID: 18745438
Thank you very much.It helped me a lot
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:amukta
ID: 18745490
Thank you very much
0
 

Author Comment

by:amukta
ID: 18745494
THnak you very much
0
 
LVL 16

Expert Comment

by:AlexNek
ID: 18746585
You are welcome. Thank you too.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now