Solved

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

Posted on 2007-03-18
6
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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