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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:46:45+00:00 2026-05-28T13:46:45+00:00

I got a file which has dates stored as the following format (yyyy|dMM|dd). I

  • 0

I got a file which has dates stored as the following format (yyyy|dMM|dd). I now need to retrieve the values from this file and set the datetimepicker to the correct year month and day matching the ones in the stored string. Im able to retrieve all data correctly only i dont know how to set the calander correctly matching the strings. This is what i got so far although it doesnt work:

string[] editdate = clean[3].Split('|');
EditDatepickCalendar.Value = DateTime.Parse("{0},{1},{2}", editdate[0], editdate[1], editdate[2]);
  • 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-28T13:46:46+00:00Added an answer on May 28, 2026 at 1:46 pm

    If sounds like you should just be using DateTime.ParseExact:

    DateTime date = DateTime.ParseExact(clean[3], "yyyy'|'MM'|'dd",
                                        CultureInfo.InvariantCulture);
    

    Quoting the | isn’t strictly necessary here, but it makes it clear that you’re just intending them to be taken as literal text, rather than having any date/time-related meaning.

    (Note that the problem really isn’t anything to do with the DateTimePicker here – it’s parsing the value. When you run into an issue, you should perform appropriate diagnostics to work out where it is – in the UI, data tranformation, storage etc.)

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

Sidebar

Related Questions

I've got a project which has a manifest file (which includes a version number),
I got a string from parsing a XML file which looks like this: Fri,
I have got a single file in which I need specify classes in multiple
I've got a file with some book data in MARC format, of which some
i've got the following code which runs a bat file. the bat file then
I've got the following java code, which is giving the error below: import java.io.File;
Lets say I've got a file in D: which has a filepath as: D:\work\2012\018\08\2b558ad8-4ea4-4cb9-b645-6c9a9919ba01
I have the following mapping in my Castle Windsor xml file which has worked
So I am reading from a text file which has product information I have
I have a text file which has got several names in it example: mathew

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.