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

The Archive Base Latest Questions

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

I have a strange business requirement to output dates as 01:00 through 24:00, instead

  • 0

I have a strange business requirement to output dates as 01:00 through 24:00, instead of the usual 00:00 through 23:00. It is really a crazy requirement, but unfortunately I don’t think I can avoid it.

This will be a configuration option in our software, so I’ll still need to support the normal 00-23 as well, so I’m hoping I can do this somehow with format strings. But I’m also considering using a regex to post-process the result string if that makes it easier.

Thanks!

  • 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-16T16:30:27+00:00Added an answer on May 16, 2026 at 4:30 pm

    This sounds like a good candidate for a wrapper class which is used to format the DateTime according to business rules:

    public class BusinessDateTimeFormatter
    {
        public BusinessDateTimeFormatter(DateTime dateTime)
        {
            _dateTime = dateTime;
        }
    
        public override string ToString()
        {
            return String.Format("{0} {1}:{2}", _dateTime.Date, _dateTime.Hour + 1, _dateTime.Minute);
        }
    }
    

    Alternatively, and perhaps even more correctly, you can create a type which represents the business’s idea of a DateTime. In object-oriented design, this replacement of primitive types with custom types happens frequently, since the domain to be modeled has special restrictions just like this one that you describe.

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

Sidebar

Related Questions

I have strange issue. ModelState has error. But I don`t have a rule for
ok, this might sound strange, but i have a form and our business wants
I tried to draw a model with 197 polygons but i have strange black
I know it's a simple question, but I have strange behaviour in here. <pre>
I have strange problem for which I can't think of a solution. I have
i have strange behaviour of git - push is working, but clone is not
I'm parsing HTML code in url var, but I have an strange problem with
I have started working with ZK recently. I really like the framework but I
I have strange issue with nested left-joins in postgresql... It's hard to explain, but
We have a Student class in our business model. something struck me as strange,

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.