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 7601887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:16:19+00:00 2026-05-30T23:16:19+00:00

The following case: There is a string that has this format 2012-02-25 07:53:04 But

  • 0

The following case:
There is a string that has this format “2012-02-25 07:53:04”

But in the end, i rather want to end up with this format “25-02-2012 07:53:04”

I think i have 2 options. 1 would be to reformat the string and move it all around, but i dont think this is a clean way of doing this.

A other way that i was thinking about is to save the source string to a date parameter, and then write the date parameter back to a string in a certain date format.
But is this even possible to do ?

  • 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-05-30T23:16:20+00:00Added an answer on May 30, 2026 at 11:16 pm

    Do this:

    DateTime.Parse("2012-02-25 07:53:04").ToString("dd-MM-yyyy hh:mm:ss");
    

    Keep in mind this isn’t culture-aware. And if you do need to store the intermediate result you could do that just as easily:

    var myDate = DateTime.Parse("2012-02-25 07:53:04");
    var myDateFormatted = myDate.ToString("dd-MM-yyyy hh:mm:ss");
    

    Lastly, check out TryParse() if you can’t guarantee the input format will always be valid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following use case: There's a class called Template and with that
I have a program that has the following code: foreach (string section in DataAccessLayer.AcceptedSections)
I have the following case where I want to accept the following routs '/type/view/23'
I know that something similar to this has been answered before but its not
This has probably been answered somewhere before but since there are millions of unrelated
When my browser renders the following test case, there's a gap below the image.
Is there a valid way to do the following in Haskell: case n of
What is the better practice of the following two switch/case statements? Is there an
Is there any way to do the following in HQL: SELECT case when flag
I have the following case: All boats have a boat type like shark ,

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.