Solved

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

Posted on 2007-03-18
6
301 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 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