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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:48:48+00:00 2026-06-04T19:48:48+00:00

Im trying to parse a string a DateTime object. No problem there :-) My

  • 0

Im trying to parse a string a DateTime object. No problem there 🙂
My problem comes, when i try to do it directly in a property set method.

I thought i could do this:

        private DateTime _fromDate;
        public DateTime FromDate
        {
            get { return _fromDate; }
            set { _fromDate = DateTime.Parse(value); }
        }

But I get this error:

“Argument 1: cannot convert from ‘System.DateTime’ to ‘string'”

Does anyone know how to do this, if it can be done at all?

  • 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-04T19:48:49+00:00Added an answer on June 4, 2026 at 7:48 pm

    Simple Use

    private DateTime _fromDate;
    public DateTime FromDate
        {
            get { return _fromDate; }
            set { _fromDate = value; }
        }
    

    value will be of DateTime as the property is of DateTime. When someone will assign this property a DateTime object it will go in value. In Set that value will be assigned to _fromDate

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

Sidebar

Related Questions

I'm trying to parse a String into a DateTime object but it seems to
I am trying to parse a String in dd-MM-yy format to a Date object.
I am trying to parse a string of HTML tag attributes in php. There
I am trying to parse a French date to a DateTime object with no
I'm trying to parse a date/time string using DateTime.ParseExact . It works everywhere, except
I'm receiving .NET's DateTime object as json string through my asmx webservice and trying
How to populate C# DateTime object from this 03-06-2012 08:00 am string. I'm trying
I am getting an error when trying to parse a string to datetime. I
I'm trying to parse an international datetime string similar to: 24-okt-08 21:09:06 CEST So
Im trying to parse the string located in /proc/stat in a linux filesystem using

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.