Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8352715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:02:38+00:00 2026-06-09T09:02:38+00:00

string DateCreated = 2012-05-24 12:34:40.060; USA culture How do I create the string into

  • 0

string DateCreated = "2012-05-24 12:34:40.060"; USA culture

How do I create the string into a Date time object with a format that include the month,
day, year, hour, minutes, seconds, milliseconds.
I think the format is this “MM/dd/yyyy hh:mm:ss.fff tt” but not sure.
** ** = underline in red, its an error

I need the datetime object because I want to pass it through another function that only accept a value of “DateTime” and not a string

Any help would be appreciated.

Thank You

this is what I have so far but i know its wrong

  string DateCreated = "2012-05-24 12:34:40.060";
  DateTime dt = **new DateTime(DateCreated);** 
  DateTime dateCreated = **dateCreated.ToString("MM/dd/yyyy hh:mm:ss.fff tt")**;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:02:43+00:00Added an answer on June 9, 2026 at 9:02 am
    var dateTime = DateTime.ParseExact(DateCreated, "yyyy-MM-dd HH:mm:ss.fff");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the Javascript Date(string) constructor with a date format of yyyy-mm-dd. The constructor
How do I format the string result of DateTime.Now in C# for insertion into
I am trying to convert a string into Date using Derived column and I
string name = bob; object obj = name; obj = joe; Console.WriteLine(name); I'm a
i have this function protected function insert($data){ $data['datecreated'] = date('Y-m-d h:i:s'); echo array_keys(data) =
Newbie question here! I'm building a simple application that allows users to create and
Scenario 1: I have two classes: Post : class Post { String content Date
I am trying to create a lambda expression (Linq, C# 3.5) that can perform
I have a Record class as : class Record { Date dateCreated Date lastUpdated
It's an homework. I have to implement the following: private Date dateCreated which store,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.