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

  • Home
  • SEARCH
  • 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 6636037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:08:01+00:00 2026-05-25T23:08:01+00:00

I have a question regarding the design of the Date object in the .Net

  • 0

I have a question regarding the design of the Date object in the .Net framework, more specifically the Now property.

I know that Now is a property that is a Date type. (This makes sense since I see the methods .AddHours(), AddYears(), etc) If Now being a class(or struct) how does it return a value directly.

For example: How would I create a class or struct in C#/VB.net that would allow me to do the same without calling a property of Now?

(VB.Net)
Dim WeatherObject as new WeatherReporter()

If WeeatherReport had a property called TodaysWeather that was a class how could I then get a value like this

Dim PlainTextReport as string=WeeatherReport.TodaysWeather

To me it seems like you would have to call a another property off of TodaysWeather. But with the Datetime.Now example you don’t. Anyways, I know its an odd question. I was just trying to better understand how some of these objects are set up under the hood

Thanks for any light on the matter.

Here is an example of code referring to the above question.

Public Class WeatherReporter
    Shared ReadOnly Property TodaysWeather As DayWeather
        Get
            TodaysWeather = New DayWeather
            Return TodaysWeather.Current
        End Get
    End Property
End Class

Public Class DayWeather
    Public Property Current As String = "Sunny"
End Class

Now similar to the DateTime.Now object

How could one you the weather example like this

Dim TheForecast as string=WeatherReporter.TodaysWeather 

It seems like it would require the following

Dim TheForecast as string=WeatherReporter.TodaysWeather.Current

I know its a confusing question, lol. thanks for your patience

  • 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-25T23:08:02+00:00Added an answer on May 25, 2026 at 11:08 pm

    DateTime.Now looks something like this in VB.net…

    public structure DateTime
    
        ...other code...
    
        ''// `shared` makes this a class property, not an instance property.
        ''// This is what lets you say `DateTime.Now`
        public shared readonly property Now as DateTime
            get
                ... do some magic to return the current date/time ...
            end get
        end property
    
        ... other code ...
    
    end class
    

    or in C#:

    public struct DateTime
    {
        ... other code ...
    
        // `static` works like VB's `shared` here
        public static DateTime Now
        {
            get { /* do your magic to return the current date/time */ }
        }
    
        ... other code ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question regarding my database design and its implementation that i am
I have a question regarding class design. I want to have a class that
I have more of a design question regarding the necessity of a CustomWritable for
I have a question regarding the most efficient way to design a class that
I have a question regarding type conversion in C#. Object data_obj = test; string
I have a question regarding the design of two tables. Table 1: The main
I have a question regarding the proper way to modify a php DateTime object.
I have a question regarding DataBase design. I have a Entity Table named: CARS
I have a question regarding the MVVM design for C#/WPF. I've had a look
I have a question regarding the concept of contextual action bar. The Android Design

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.